Erlang
public enum Erlang
Erlang distribution (equal to the Gamma distribution with integer shape parameter)
-
Returns a SSProbDistParams struct containing mean, variance, kurtosis and skewness of the Erlang distribution.
Throws
SSSwiftyStatsError if a <= 0Declaration
Swift
public static func para<FPT>(shape k: UInt, rate lambda: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
a
Shape parameter
b
Scale parameter
-
Returns the pdf of the Erlang distribution.
Throws
SSSwiftyStatsError if a <= 0Declaration
Swift
public static func pdf<FPT>(x: FPT, shape k: UInt, rate lambda: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
x
x
a
Shape parameter
b
Scale parameter
-
Returns the cdf of the Erlang distribution.
Throws
SSSwiftyStatsError if a <= 0Declaration
Swift
public static func cdf<FPT>(x: FPT, shape k: UInt, rate lambda: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
x
x
a
Shape parameter
b
Scale parameter
-
Returns the quantile of the Erlang distribution.
Throws
SSSwiftyStatsError if a <= 0 || p < 0 || p > 1Declaration
Swift
public static func quantile<FPT>(p: FPT, shape k: UInt!, rate lambda: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
p
p
a
Shape parameter
b
Scale parameter