NonCentralChiSquare

public enum NonCentralChiSquare

Non central Chi Square distribution

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

    Throws

    SSSwiftyStatsError if df <= 0

    Declaration

    Swift

    public static func para<FPT>(degreesOfFreedom df: FPT, lambda: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    df

    Degrees of freedom

    lambda

    noncentrality parameter

  • Returns the pdf of the Chi^2 distribution.

    Throws

    SSSwiftyStatsError if df <= 0

    Declaration

    Swift

    public static func pdf<FPT>(chi: FPT, degreesOfFreedom df: FPT, lambda: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    chi

    Chi

    df

    Degrees of freedom

    lambda

    Noncentrality

  • Returns the cdf of the Chi^2 distribution.

    Throws

    SSSwiftyStatsError if df <= 0

    Note

    Uses an algorithm proposed by Gil, Segura and Temme to compute the Marcum function (2014)

    Declaration

    Swift

    public static func cdf<FPT>(chi: FPT, degreesOfFreedom df: FPT, lambda: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    chi

    Chi

    df

    Degrees of freedom

    lambda

    Noncentrality

  • Returns the p-quantile of the Chi^2 distribution.

    Throws

    SSSwiftyStatsError if df <= 0

    Declaration

    Swift

    public static func quantile<FPT>(p: FPT, degreesOfFreedom df: FPT, lambda: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    p

    p

    df

    Degrees of freedom

    lambda

    Noncentrality