NonCentralSudentT

public enum NonCentralSudentT

Non central Student T distribution

  • Returns a SSProbDistParams struct containing mean, variance, kurtosis and skewness of the noncentral Student’s T distribution.

    Throws

    SSSwiftyStatsError if df <= 0

    Declaration

    Swift

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

    Parameters

    df

    Degrees of freedom

    nonCentralityPara

    noncentrality parameter

  • Returns the cdf of the noncentral Student t distribution.

    NOTE

    This functions uses an algorithm supposed by Viktor Witkovsky (witkovsky@savba.sk): Witkovsky V. (2013). A Note on Computing Extreme Tail

    Probabilities of the Noncentral T Distribution with Large

    Noncentrality Parameter. Working Paper, Institute of Measurement

    Science, Slovak Academy of Sciences, Bratislava.

    The algorithm uses a Gauss-Kronrod quadrature with an error less than 1e-12 over a wide range of parameters. To reduce the error (in case of extreme parameters) the number of subintervals can be adjusted. Swift Version © strike65 2018

    Declaration

    Swift

    public static func cdf<T>(t: T, degreesOfFreedom df: T, nonCentralityPara lambda: T, rlog: Bool! = false) throws -> T where T : Decodable, T : Encodable, T : SSFloatingPoint

    Parameters

    x

    x

    df

    degrees of freedom

    ncp

    noncentrality parameter

    tail

    tail

    nSubIntervals

    Number of subintervals. Possible values: 32,16,12,10,8,6,4,2. Default is set to 16.

    Return Value

    The tuple (cdf:, error:)

  • Returns the pdf of the non-central Student’s t-distribution where H is the Hermite polynomial

    Throws

    SSSwiftyStatsError if df <= 0

    Declaration

    Swift

    public static func pdf<FPT>(x: FPT, degreesOfFreedom df: FPT, nonCentralityPara lambda: FPT, rlog: Bool! = false) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    x

    x

    nonCentralityPara

    noncentrality parameter

    df

    Degrees of freedom

    rlog

    Return log(pdf)

  • Returns the quantile function of the noncentral Student’s t-distribution

    Throws

    SSSwiftyStatsError if df <= 0 or/and p < 0 or p > 1.0

    Declaration

    Swift

    public static func quantile<FPT>(p: FPT, degreesOfFreedom df: FPT, nonCentralityPara lambda: FPT, rlog: Bool! = false) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    p

    p

    nonCentralityPara

    noncentrality parameter

    df

    Degrees of freedom