Laplace

public enum Laplace

Laplace distribution

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

    Throws

    SSSwiftyStatsError if b <= 0

    Declaration

    Swift

    public static func para<FPT>(mean: FPT, scale b: FPT) throws -> SSProbDistParams<FPT> where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    mean

    mean

    b

    Scale parameter b

  • Returns the pdf of the Laplace distribution.

    Throws

    SSSwiftyStatsError if b <= 0

    Declaration

    Swift

    public static func pdf<FPT>(x: FPT, mean: FPT, scale b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    x

    x

    mean

    mean

    b

    Scale parameter b

  • Returns the cdf of the Laplace distribution.

    Throws

    SSSwiftyStatsError if b <= 0

    Declaration

    Swift

    public static func cdf<FPT>(x: FPT, mean: FPT, scale b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    x

    x

    mean

    mean

    b

    Scale parameter b

  • Returns the quantile of the Laplace distribution.

    Throws

    SSSwiftyStatsError if b <= 0 || p < 0 || p > 1

    Declaration

    Swift

    public static func quantile<FPT>(p: FPT, mean: FPT, scale b: FPT) throws -> FPT where FPT : Decodable, FPT : Encodable, FPT : SSFloatingPoint

    Parameters

    p

    p

    mean

    mean

    b

    Scale parameter b