Binomial
public enum Binomial
Binomial distribution
-
Returns the cdf of the Binomial Distribution
Declaration
Swift
public static func cdf<FPT>(k: Int, n: Int, probability p0: FPT, tail: SSCDFTail) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
k
number of successes
n
number of trials
p0
probability for success
tail
.lower, .upper
-
Returns the pdf of the Binomial Distribution
Declaration
Swift
public static func pdf<FPT>(k: Int, n: Int, probability p0: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
k
number of successes
n
number of trials
p0
probability for success
-
Returns a SSProbDistParams struct containing mean, variance, kurtosis and skewness of the Binomial distribution.
Throws
SSSwiftyStatsError if a >= b || c <= a || c >= bDeclaration
Swift
public static func para<FPT>(numberOfTrials n: Int, probability p0: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint
Parameters
n
Number of trials
p0
Probability for success