Probability distributions, portable between the JVM and JavaScript.
A distribution is a value (a record) with
(draw d) a sample, from the current generator
(foerster.random: a world's stream at a site)
(logpdf d x) the log density, or log mass for a discrete law;
##-Inf outside the support
(cdf d x) (quantile d p) (mean d) (variance d) where defined
Names and parameterizations follow raster's distributions
(raster.sci.distributions, and Distributions.jl): Normal[mu sigma],
Uniform[a b], Exponential[lambda] (rate), Gamma[alpha beta] (shape, SCALE:
mean αβ), Beta[alpha beta], Poisson[lambda]. A model's site laws and a
raster block's compiled densities therefore mean the same thing.
Probability distributions, portable between the JVM and JavaScript.
A distribution is a value (a record) with
(draw d) a sample, from the current generator
(`foerster.random`: a world's stream at a site)
(logpdf d x) the log density, or log mass for a discrete law;
##-Inf outside the support
(cdf d x) (quantile d p) (mean d) (variance d) where defined
Names and parameterizations follow raster's distributions
(`raster.sci.distributions`, and Distributions.jl): Normal[mu sigma],
Uniform[a b], Exponential[lambda] (rate), Gamma[alpha beta] (shape, SCALE:
mean αβ), Beta[alpha beta], Poisson[lambda]. A model's site laws and a
raster block's compiled densities therefore mean the same thing.(bernoulli p)1 with probability p, else 0.
1 with probability p, else 0.
(binomial n p)Successes in n ≥ 0 trials of success probability p ∈ [0, 1].
Successes in n ≥ 0 trials of success probability p ∈ [0, 1].
(categorical outcomes)A value with probability ∝ its weight: outcomes a map {value weight}
or a sequence of [value weight] pairs.
A value with probability ∝ its weight: `outcomes` a map {value weight}
or a sequence of [value weight] pairs.(cauchy location scale)Cauchy with location x₀ and scale γ > 0.
Cauchy with location x₀ and scale γ > 0.
(chi-squared k)χ² with k > 0 degrees of freedom.
χ² with k > 0 degrees of freedom.
(-continuous? d)Whether d is a law on (an interval of) the reals.
Whether `d` is a law on (an interval of) the reals.
(continuous? d)Whether d is a law on (an interval of) the reals: a scalar site a
random walk can move.
Whether `d` is a law on (an interval of) the reals: a scalar site a random walk can move.
(dirichlet alpha)Dirichlet(α) over the simplex, every αᵢ > 0.
Dirichlet(α) over the simplex, every αᵢ > 0.
(discrete weights)An index i with probability weights[i] / Σ weights; weights ≥ 0.
An index i with probability weights[i] / Σ weights; weights ≥ 0.
(draw-logpdf d x)The log density of x under what (draw d) samples: logpdf, unless d
draws from something else (a block's :sample).
The log density of `x` under what `(draw d)` samples: `logpdf`, unless `d` draws from something else (a block's `:sample`).
(-draw-logpdf d x)The log density of x under what draw samples, or nil when that is
the distribution itself (logpdf).
The log density of `x` under what `draw` samples, or nil when that is the distribution itself (`logpdf`).
(exponential lambda)Exponential with rate λ > 0.
Exponential with rate λ > 0.
(-support d)The values of a distribution with finite support, in order; nil when its support is infinite or continuous.
The values of a distribution with finite support, in order; nil when its support is infinite or continuous.
(gamma alpha beta)Gamma with shape α > 0 and SCALE β > 0 (mean αβ).
Gamma with shape α > 0 and SCALE β > 0 (mean αβ).
(half-cauchy scale)|Cauchy(0, γ)|, γ > 0: a heavy-tailed prior for a scale.
|Cauchy(0, γ)|, γ > 0: a heavy-tailed prior for a scale.
(half-normal sigma)|Normal(0, σ)|, σ > 0: a prior for a scale.
|Normal(0, σ)|, σ > 0: a prior for a scale.
(lgamma x)log Γ(x) (Lanczos, g = 7): about 15 significant digits.
log Γ(x) (Lanczos, g = 7): about 15 significant digits.
(log-normal mu sigma)exp of Normal(μ, σ), σ > 0.
exp of Normal(μ, σ), σ > 0.
(logpdf d x)The log density (log mass) of d at x.
The log density (log mass) of `d` at `x`.
(mvn mean cov)Multivariate normal with mean (a vector) and covariance cov (vectors of
rows, symmetric positive definite).
Multivariate normal with `mean` (a vector) and covariance `cov` (vectors of rows, symmetric positive definite).
(negative-binomial r p)Failures before the r-th success, success probability p ∈ (0, 1]; r > 0 need not be whole.
Failures before the r-th success, success probability p ∈ (0, 1]; r > 0 need not be whole.
(normal mu sigma)Normal(μ, σ), σ > 0 the standard deviation.
Normal(μ, σ), σ > 0 the standard deviation.
(normal-cdf z)Φ(z), the standard normal CDF: ½ Q(½, z²/2) below 0, which keeps its relative precision deep into the tail.
Φ(z), the standard normal CDF: ½ Q(½, z²/2) below 0, which keeps its relative precision deep into the tail.
(normal-quantile p)Φ⁻¹(p) (Wichura 1988, AS241 PPND16): about 16 significant digits.
Φ⁻¹(p) (Wichura 1988, AS241 PPND16): about 16 significant digits.
(quantile d p)The p-quantile of d, p in [0, 1].
The p-quantile of `d`, p in [0, 1].
(regularized-gamma-p a x)P(a, x) = γ(a, x)/Γ(a), the regularized lower incomplete gamma function.
P(a, x) = γ(a, x)/Γ(a), the regularized lower incomplete gamma function.
(regularized-gamma-q a x)Q(a, x) = 1 − P(a, x), computed directly in the upper tail.
Q(a, x) = 1 − P(a, x), computed directly in the upper tail.
(student-t nu)(student-t nu mu sigma)Student's t with ν degrees of freedom, location μ and scale σ.
Student's t with ν degrees of freedom, location μ and scale σ.
(support d)The values d can take, when finitely many (exact enumeration walks
them); nil otherwise.
The values `d` can take, when finitely many (exact enumeration walks them); nil otherwise.
(uniform-discrete a b)The integers a, a+1, …, b−1, equally likely (a < b).
The integers a, a+1, …, b−1, equally likely (a < b).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |