Expand description
Probability distributions. Each has a density, a cumulative distribution, a quantile function and a sampler. The first three are also function objects, Pdf, Cdf and Quantile, which hold the distribution. Their slice forms choose the distribution’s formulas once, outside the loop, so the loops of the closed-form distributions vectorize. Their one-item forms run the slice forms on one item. An item of a slice form fails where its result is NaN and its argument isn’t, as for a quantile of p outside 0 to 1. A discrete distribution’s density is its mass at a whole x, and its quantile function and sampler give whole numbers.
Modules§
- standard
- The standard parameters of the distributions that have them, in the order their constructors take them.
Structs§
- Cdf
Distribution::cdfas a function object. The normal and log-normal distributions’ slice forms take erfc fromErfc’s slice form, which computes only the formulas that each block of arguments needs. The Cauchy distribution’s takes atan fromAtan’s, and the Weibull distribution uses the shared [Pow] formula.- Distribution
- A probability distribution, whose constructor checked its parameters.
- Invalid
- A parameter outside its distribution’s domain, with a message that says which.
Distribution::pdfas a function object. The log-normal distribution’s slice form takes ln fromLn’s slice form, which vectorizes where a loop of whole densities doesn’t. The Weibull distribution uses the shared [Pow] formula.- Quantile
Distribution::quantileas a function object, through [quantiles]. The normal and log-normal distributions’ slice forms take erfcinv(2p) fromErfcinv’s slice form, whose loops don’t branch on each item’s region. Logarithms useLog1pandLnslice forms; tangent and root use the shared [Tan] and [Root] formulas.