@bmancini55/finance
Version:
Finance utilities for JavaScript
47 lines (46 loc) • 1.15 kB
TypeScript
export declare class Normal {
/**
* Standard normal distribution has mean=0 and stddev=1
*/
static standard: Normal;
/**
* Calculates the error function at x based on the
* Python Math.erf implementation
* https://docs.python.org/2/library/math.html#math.erf
* @param x
*/
static erf(x: number): number;
/**
* Mean of this distribution
*/
mean: number;
/**
* Stadard deviation for this distribution
*/
stddev: number;
/**
* Variance for this distribution
*/
variance: number;
/**
* Creates a normal distrubtion with the supplied mean and
* standard deviation.
*
* @remarks https://en.wikipedia.org/wiki/Normal_distribution
* @param mean
* @param stddev
*/
constructor(mean: number, stddev: number);
/**
* Calculates the approximation of the CDF.
* @param x value
* @returns approximate CDF
*/
cdf(x: number): number;
/**
* Calculates the derivative of the CDF, the PDF.
* @param x value
* @returns the PDF value
*/
pdf(x: number): number;
}