A TypeScript model of a Gaussian distribution
npm install @searchlight.ai/gaussian-typescript
A Typescript model of the Normal
(or Gaussian) distribution.
``typescript
import { Gaussian } from "@searchlight.ai/gaussian-typescript";
const distribution = new Gaussian(mean, variance);
const cdf = distribution.cdf(25);
cdf.add(new Gaussian(1,2))
`
- mean: the mean (μ) of the distributionvariance
- : the variance (σ^2) of the distributionstandardDeviation
- : the standard deviation (σ) of the distribution
- pdf(x): the probability density function, which describes the probabilitycdf(x)
of a random variable taking on the value _x_
- : the cumulative distribution function, which describes theppf(x)
probability of a random variable falling in the interval (−∞, _x_]
- : the percent point function, the inverse of _cdf_
: updates the product distribution of this and the given distribution;
- div(d): updates the quotient distribution of this and the given distribution;
- mul_constant(d): updates scale(d); equivalent to calling mul(d: number)
- div_constant(d): updates scale(1/d); equivalent to calling div(d: number)
- add(d): updates the result of adding this and the given distribution's means and variances
- sub(d): updates the result of subtracting this and the given distribution's means and variances
- scale(c)`: updates the result of scaling this distribution by the given constant__Source__: https://github.com/errcw/gaussian