module

Alea::CDF

Alea::CDF is the interface used to calculate the Cumulative Distribution Functions. Given X ~ D and a fixed quantile x, CDFs are defined as the functions that associate x to the probability that the real-valued random X from the distribution D will take a value less or equal to x.

Arguments passed to Alea::CDF methods to shape the distributions are analogous to those used for sampling:

Alea::CDF.normal(0.0)                       # => 0.5
Alea::CDF.normal(2.0, loc: 1.0, sigma: 0.5) # => 0.9772498680518208
Alea::CDF.chisq(5.279, df: 5.0)             # => 0.6172121213841358

NOTE: for real-valued quantiles is used x, k for discrete-valued instead.

Class methods

chisq(x, df) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • df: degrees of freedom of the distribution; usually mentioned as k.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if df is negative or zero.
Source
chisq32(x, df) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • df: degrees of freedom of the distribution; usually mentioned as k.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if df is negative or zero.
Source
exp(x, scale = 1.0) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • scale: scale parameter of the distribution; usually mentioned as λ^-1.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if scale is negative or zero.
Source
exp32(x, scale = 1.0_f32) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • scale: scale parameter of the distribution; usually mentioned as λ^-1.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if scale is negative or zero.
Source
gamma(x, shape, scale = 1.0) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • shape: shape parameter of the distribution; usually mentioned as k.
  • scale: scale parameter of the distribution; usually mentioned as θ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if any of shape or scale is negative or zero.
Source
gamma32(x, shape, scale = 1.0_f32) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • shape: shape parameter of the distribution; usually mentioned as k.
  • scale: scale parameter of the distribution; usually mentioned as θ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if any of shape or scale is negative or zero.
Source
laplace(x, loc = 0.0, scale = 1.0) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • loc: centrality parameter, or mean of the distribution; usually mentioned as μ.
  • scale: scale parameter of the distribution; usually mentioned as b.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if scale is negative or zero.
Source
laplace32(x, loc = 0.0_f32, scale = 1.0_f32) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • loc: centrality parameter, or mean of the distribution; usually mentioned as μ.
  • scale: scale parameter of the distribution; usually mentioned as b.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if scale is negative or zero.
Source
lognormal(x, loc = 0.0, sigma = 1.0) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • loc: centrality parameter, or mean of the underlying normal distribution; usually mentioned as μ.
  • sigma: scale parameter, or standard deviation of the underlying normal distribution; usually mentioned as σ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if sigma is negative or zero.
Source
lognormal32(x, loc = 0.0_f32, sigma = 1.0_f32) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • loc: centrality parameter, or mean of the underlying normal distribution; usually mentioned as μ.
  • sigma: scale parameter, or standard deviation of the underlying normal distribution; usually mentioned as σ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if sigma is negative or zero.
Source
normal(x, loc = 0.0, sigma = 1.0) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • loc: centrality parameter, or mean of the distribution; usually mentioned as μ.
  • sigma: scale parameter, or standard deviation of the distribution; usually mentioned as σ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if sigma is negative or zero.
Source
normal32(x, loc = 0.0_f32, sigma = 1.0_f32) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • loc: centrality parameter, or mean of the distribution; usually mentioned as μ.
  • sigma: scale parameter, or standard deviation of the distribution; usually mentioned as σ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if sigma is negative or zero.
Source
poisson(k, lam = 1.0) : Float64

Calculate the cumulative distribution function evaluated at k.

@parameters:

  • k: discrete-valued quantile of which estimate the cdf.
  • lam: separation parameter of the distribution; usually mentioned as λ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if lam is negative or zero.
Source
poisson32(k, lam = 1.0_f32) : Float32

Calculate the cumulative distribution function evaluated at k.

@parameters:

  • k: discrete-valued quantile of which estimate the cdf.
  • lam: separation parameter of the distribution; usually mentioned as λ.

@exceptions:

  • Alea::NaNError if any of the arguments is NaN.
  • Alea::InfinityError if any of the arguments is Infinity.
  • Alea::UndefinedError if lam is negative or zero.
Source
uniform(x, min, max) : Float64

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • min: left bound parameter of range of the distribution; usually mentioned as a.
  • max: right bound parameter of range of the distribution; usually mentioned as b.

@notes:

  • range is [min, max).

@exceptions:

  • Alea::NaNError if any of the arguments bound is NaN.
  • Alea::InfinityError if any of the arguments bound is Infinity.
  • Alea::UndefinedError if max is less than min.
Source
uniform32(x, min, max) : Float32

Calculate the cumulative distribution function evaluated at x.

@parameters:

  • x: real-valued quantile of which estimate the cdf.
  • min: left bound parameter of range of the distribution; usually mentioned as a.
  • max: right bound parameter of range of the distribution; usually mentioned as b.

@notes:

  • range is [min, max).

@exceptions:

  • Alea::NaNError if any of the arguments bound is NaN.
  • Alea::InfinityError if any of the arguments bound is Infinity.
  • Alea::UndefinedError if max is less than min.
Source