Triangular
public enum Triangular
Triangular distribution
-
Returns a SSProbDistParams struct containing mean, variance, kurtosis and skewness of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= b || c <= a || c >= bDeclaration
Swift
public static func para<FPT>(lowerBound a: FPT, upperBound b: FPT, mode c: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
a
Lower bound
b
Upper bound
c
Mode
-
Returns the pdf of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= b || c <= a || c >= bDeclaration
Swift
public static func pdf<FPT>(x: FPT, lowerBound a: FPT, upperBound b: FPT, mode c: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
x
x
a
Lower bound
b
Upper bound
c
Mode
-
Returns the cdf of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= b || c <= a || c >= bDeclaration
Swift
public static func cdf<FPT>(x: FPT, lowerBound a: FPT, upperBound b: FPT, mode c: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
x
x
a
Lower bound
b
Upper bound
c
Mode
-
Returns the quantile of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= b || c <= a || c >= b || p < 0 || p > 0Declaration
Swift
public static func quantile<FPT>(p: FPT, lowerBound a: FPT, upperBound b: FPT, mode c: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
p
p
a
Lower bound
b
Upper bound
c
Mode
-
Returns a SSProbDistParams struct containing mean, variance, kurtosis and skewness of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= bDeclaration
Swift
public static func para<FPT>(lowerBound a: FPT, upperBound b: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
a
Lower bound
b
Upper bound
-
Returns the pdf of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= bDeclaration
Swift
public static func pdf<FPT>(x: FPT, lowerBound a: FPT, upperBound b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
x
x
a
Lower bound
b
Upper bound
-
Returns the cdf of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= bDeclaration
Swift
public static func cdf<FPT>(x: FPT, lowerBound a: FPT, upperBound b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
x
x
a
Lower bound
b
Upper bound
-
Returns the quantile of the Triangular distribution.
Throws
SSSwiftyStatsError if a >= b || p < 0 || p > 0Declaration
Swift
public static func quantile<FPT>(p: FPT, lowerBound a: FPT, upperBound b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
p
p
a
Lower bound
b
Upper bound