/** * Base class of the continuous distributions. */ export class ContinuousDistribution { /** Lower end of the support. */ get support(): number[]; /** * Probability density function. * @param {number|Array} x * @returns {number|Array} */ pdf(x: number | any[]): number | any[]; /** * Logarithm of the probability density function. * @param {number|Array} x * @returns {number|Array} */ logpdf(x: number | any[]): number | any[]; /** * Cumulative distribution function P(X <= x). * @param {number|Array} x * @returns {number|Array} */ cdf(x: number | any[]): number | any[]; /** * Survival function P(X > x) = 1 - cdf(x), computed accurately in the upper tail. * @param {number|Array} x * @returns {number|Array} */ sf(x: number | any[]): number | any[]; /** * Logarithm of the cumulative distribution function. * @param {number|Array} x * @returns {number|Array} */ logcdf(x: number | any[]): number | any[]; /** * Logarithm of the survival function. * @param {number|Array} x * @returns {number|Array} */ logsf(x: number | any[]): number | any[]; /** * Percent point function (quantile, inverse of the cdf). * @param {number|Array} q - Probabilities in [0, 1]. * @returns {number|Array} */ ppf(q: number | any[]): number | any[]; /** * Inverse survival function: x such that sf(x) = q. * @param {number|Array} q - Probabilities in [0, 1]. * @returns {number|Array} */ isf(q: number | any[]): number | any[]; /** * Draws random samples. * @param {number|number[]|null} [size=null] - Output shape. * @param {Object} [rng] - Optional `Generator` to draw from instead of the global generator. * @returns {number|Array} */ sample(size?: number | number[] | null, rng?: any): number | any[]; /** Alias of {@link ContinuousDistribution#sample} (scipy name). */ rvs(size?: any, rng?: any): number | any[]; /** @returns {number} The mean. */ mean(): number; /** @returns {number} The variance. */ variance(): number; /** @returns {number} The standard deviation. */ std(): number; /** @returns {number} The median. */ median(): number; /** * Equal-tail interval containing a fraction `confidence` of the probability mass. * @param {number} confidence - In [0, 1]. * @returns {number[]} [lower, upper] */ interval(confidence: number): number[]; /** @protected */ protected _sf(x: any): number; /** @protected */ protected _isf(q: any): number; /** * Generic quantile by bracketing and bisection on the cdf. * @protected */ protected _ppf(p: any): number; /** @protected */ protected _sample(size: any): any; } /** * Base class of the discrete distributions (support on integers). */ export class DiscreteDistribution extends ContinuousDistribution { /** * Probability mass function. * @param {number|Array} k * @returns {number|Array} */ pmf(k: number | any[]): number | any[]; /** * Logarithm of the probability mass function. * @param {number|Array} k * @returns {number|Array} */ logpmf(k: number | any[]): number | any[]; /** @protected */ protected _cdf(x: any): number; } /** * Factories of frozen distributions, scipy.stats style. Parameters use the same names and * conventions as the corresponding sampling functions of the library. * * @namespace stats * @property {function(number=, number=): ContinuousDistribution} normal - normal(loc, scale) * @property {function(number=, number=): ContinuousDistribution} uniform - uniform(low, high) * @property {function(number=): ContinuousDistribution} exponential - exponential(rate) * @property {function(number, number=): ContinuousDistribution} gamma - gamma(shape, scale) * @property {function(number): ContinuousDistribution} chisquare - chisquare(df) * @property {function(number, number): ContinuousDistribution} beta - beta(a, b) * @property {function(number, number=, number=): ContinuousDistribution} studentT - studentT(df, loc, scale) * @property {function(number, number): ContinuousDistribution} f - f(dfnum, dfden) * @property {function(number=, number=): ContinuousDistribution} lognormal - lognormal(mu, sigma) * @property {function(number=, number=): ContinuousDistribution} cauchy - cauchy(loc, scale) * @property {function(number=, number=): ContinuousDistribution} laplace - laplace(loc, scale) * @property {function(number=, number=): ContinuousDistribution} logistic - logistic(loc, scale) * @property {function(number=, number=): ContinuousDistribution} gumbel - gumbel(loc, scale) * @property {function(number, number=): ContinuousDistribution} weibull - weibull(shape, scale) * @property {function(number, number=): ContinuousDistribution} pareto - pareto(alpha, xm) * @property {function(number, number, number): ContinuousDistribution} triangular - triangular(low, high, mode) * @property {function(number=): ContinuousDistribution} rayleigh - rayleigh(scale) * @property {function(number=, number=, number=, number=): ContinuousDistribution} truncatedNormal - truncatedNormal(loc, scale, low, high) * @property {function(number, number): DiscreteDistribution} binomial - binomial(n, p) * @property {function(number): DiscreteDistribution} poisson - poisson(lambda) * @property {function(number): DiscreteDistribution} geometric - geometric(p), support 1, 2, ... * @property {function(number, number): DiscreteDistribution} negativeBinomial - negativeBinomial(n, p) * @property {function(number, number, number): DiscreteDistribution} hypergeometric - hypergeometric(ngood, nbad, nsample) * @property {function(number): DiscreteDistribution} bernoulli - bernoulli(p) * @property {function(number, number): DiscreteDistribution} randint - randint(low, high), high excluded * @property {function(Array, number[]): ContinuousDistribution} mixture - mixture(components, weights): * finite mixture of stats distributions (all continuous or all discrete), weights normalised. */ export const stats: Readonly<{ normal: (loc: any, scale: any) => Normal; norm: (loc: any, scale: any) => Normal; uniform: (low: any, high: any) => Uniform; exponential: (rate: any) => Exponential; gamma: (shape: any, scale: any) => Gamma; chisquare: (df: any) => ChiSquare; chi2: (df: any) => ChiSquare; beta: (a: any, b: any) => Beta; studentT: (df: any, loc: any, scale: any) => StudentT; t: (df: any, loc: any, scale: any) => StudentT; f: (dfnum: any, dfden: any) => FDist; lognormal: (mu: any, sigma: any) => LogNormal; cauchy: (loc: any, scale: any) => Cauchy; laplace: (loc: any, scale: any) => Laplace; logistic: (loc: any, scale: any) => Logistic; gumbel: (loc: any, scale: any) => Gumbel; weibull: (shape: any, scale: any) => Weibull; pareto: (alpha: any, xm: any) => Pareto; triangular: (low: any, high: any, mode: any) => Triangular; rayleigh: (scale: any) => Rayleigh; truncatedNormal: (loc: any, scale: any, low: any, high: any) => TruncatedNormal; binomial: (n: any, p: any) => Binomial; poisson: (lambda: any) => Poisson; geometric: (p: any) => Geometric; negativeBinomial: (n: any, p: any) => NegativeBinomial; hypergeometric: (ngood: any, nbad: any, nsample: any) => Hypergeometric; bernoulli: (p: any) => Bernoulli; randint: (low: any, high: any) => DiscreteUniform; mixture: (components: any, weights: any) => DiscreteMixture | Mixture; }>; declare class Normal extends ContinuousDistribution { constructor(loc?: number, scale?: number); loc: number; scale: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; entropy(): number; } declare class Uniform extends ContinuousDistribution { constructor(low?: number, high?: number); low: number; high: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; entropy(): number; } declare class Exponential extends ContinuousDistribution { constructor(rate?: number); rate: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; entropy(): number; } declare class Gamma extends ContinuousDistribution { constructor(shape: any, scale?: number); shape: any; scale: number; _logpdf(x: any): number; _cdf(x: any): number; _isf(q: any): any; _sample(size: any): number | any[]; entropy(): any; } declare class ChiSquare extends Gamma { constructor(df: any); df: any; } declare class Beta extends ContinuousDistribution { constructor(a: any, b: any); a: any; b: any; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class StudentT extends ContinuousDistribution { constructor(df: any, loc?: number, scale?: number); df: any; loc: number; scale: number; _logpdf(x: any): number; _tailProb(z: any): number; _cdf(x: any): number; _standardQuantile(p: any): number; _sample(size: any): number | any[]; } declare class FDist extends ContinuousDistribution { constructor(dfnum: any, dfden: any); d1: any; d2: any; _logpdf(x: any): number; _cdf(x: any): number; _ppf(p: any): any; _isf(q: any): any; _sample(size: any): number | any[]; } declare class LogNormal extends ContinuousDistribution { constructor(mu?: number, sigma?: number); mu: number; sigma: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Cauchy extends ContinuousDistribution { constructor(loc?: number, scale?: number); loc: number; scale: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Laplace extends ContinuousDistribution { constructor(loc?: number, scale?: number); loc: number; scale: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Logistic extends ContinuousDistribution { constructor(loc?: number, scale?: number); loc: number; scale: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Gumbel extends ContinuousDistribution { constructor(loc?: number, scale?: number); loc: number; scale: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Weibull extends ContinuousDistribution { constructor(shape: any, scale?: number); k: any; scale: number; _logpdf(x: any): number; _cdf(x: any): number; } declare class Pareto extends ContinuousDistribution { constructor(alpha: any, xm?: number); alpha: any; xm: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Triangular extends ContinuousDistribution { constructor(low: any, high: any, mode: any); a: any; b: any; c: any; get support(): any[]; _logpdf(x: any): number; _cdf(x: any): number; _ppf(p: any): any; _sample(size: any): number | any[]; } declare class Rayleigh extends ContinuousDistribution { constructor(scale?: number); scale: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class TruncatedNormal extends ContinuousDistribution { constructor(loc?: number, scale?: number, low?: number, high?: number); loc: number; scale: number; low: number; high: number; a: number; b: number; flip: boolean; Phi: (z: any) => number; za: number; zb: number; mass: number; sa: number; sb: number; _logpdf(x: any): number; _cdf(x: any): number; _sample(size: any): number | any[]; } declare class Binomial extends DiscreteDistribution { constructor(n: any, p: any); n: any; p: any; get support(): any[]; _logpmf(k: any): number; _sample(size: any): number | any[]; } declare class Poisson extends DiscreteDistribution { constructor(lambda: any); lambda: any; _logpmf(k: any): number; _sample(size: any): number | any[]; mean(): any; variance(): any; } declare class Geometric extends DiscreteDistribution { constructor(p: any); p: number; _logpmf(k: any): number; _sample(size: any): number | any[]; } declare class NegativeBinomial extends DiscreteDistribution { constructor(n: any, p: any); n: any; p: number; _logpmf(k: any): number; _sample(size: any): number | any[]; } declare class Hypergeometric extends DiscreteDistribution { constructor(ngood: any, nbad: any, nsample: any); good: any; bad: any; n: any; _logpmf(k: any): number; _sample(size: any): number | any[]; } declare class Bernoulli extends Binomial { constructor(p: any); } declare class DiscreteUniform extends DiscreteDistribution { constructor(low: any, high: any); low: any; high: any; get support(): any[]; _logpmf(k: any): number; _sample(size: any): number | any[]; } /** * Finite mixture of discrete distributions: mass sum_i w_i p_i(k). */ declare class DiscreteMixture extends DiscreteDistribution { constructor(components: any, weights: any); weights: number[]; components: any; _logpmf(k: any): number; _cdf(x: any): any; _sf(x: any): any; mean(): any; variance(): any; } /** * Finite mixture of continuous distributions: density sum_i w_i f_i(x). */ declare class Mixture extends ContinuousDistribution { constructor(components: any, weights: any); weights: number[]; components: any; _logpdf(x: any): number; _cdf(x: any): any; _sf(x: any): any; mean(): any; variance(): any; } export {};