Beta

public enum Beta

Beta distribution

  • Returns a SSProbDistParams struct containing mean, variance, kurtosis and skewness of the Beta distribution.

    Throws

    SSSwiftyStatsError if a and/or b <= 0

    Declaration

    Swift

    public static func para<FPT>(shapeA a: FPT, shapeB b: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    a

    Shape parameter a

    b

    Shape parameter b

  • Returns the pdf of the Beta distribution

    Throws

    SSSwiftyStatsError if a and/or b <= 0

    Declaration

    Swift

    public static func pdf<FPT>(x: FPT, shapeA a: FPT, shapeB b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    x

    x

    a

    Shape parameter a

    b

    Shape parameter b

  • Returns the cdf of the Beta distribution

    Throws

    SSSwiftyStatsError if a and/or b <= 0

    Declaration

    Swift

    public static func cdf<FPT>(x: FPT, shapeA a: FPT, shapeB b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    x

    x

    a

    Shape parameter a

    b

    Shape parameter b

  • Returns the quantile of the Beta distribution

    Throws

    SSSwiftyStatsError if a and/or b <= 0 and/or p < 0 and/or p > 1

    Declaration

    Swift

    public static func quantile<FPT>(p: FPT, shapeA a: FPT, shapeB b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    p

    p

    a

    Shape parameter a

    b

    Shape parameter b