@Alias(value={"GaussianDistribution","normal","gauss"}) public class NormalDistribution extends AbstractDistribution
| Modifier and Type | Class and Description |
|---|---|
static class |
NormalDistribution.Parameterizer
Parameterization class
|
| Modifier and Type | Field and Description |
|---|---|
private static double[] |
ERF_COEFF1
T.
|
private static double[] |
ERF_COEFF2
T.
|
private double |
mean
Mean value for the generator
|
static double |
ONEBYPHIINV075
1 / CDFINV(0.75)
|
(package private) static double |
P_HIGH
Treshold for switching nethods for erfinv approximation
|
(package private) static double |
P_LOW
Treshold for switching nethods for erfinv approximation
|
static double |
PHIINV075
CDFINV(0.75)
|
private double |
stddev
Standard deviation
|
random| Constructor and Description |
|---|
NormalDistribution(double mean,
double stddev)
Constructor for Gaussian distribution
|
NormalDistribution(double mean,
double stddev,
java.util.Random random)
Constructor for Gaussian distribution
|
NormalDistribution(double mean,
double stddev,
RandomFactory random)
Constructor for Gaussian distribution
|
| Modifier and Type | Method and Description |
|---|---|
double |
cdf(double val)
Return the cumulative density function at the given value.
|
static double |
cdf(double x,
double mu,
double sigma)
Cumulative probability density function (CDF) of a normal distribution.
|
static double |
erf(double x)
Error function for Gaussian distributions = Normal distributions.
|
static double |
erfc(double x)
Complementary error function for Gaussian distributions = Normal
distributions.
|
static double |
erfcinv(double y)
Inverse error function.
|
double |
getMean() |
double |
getStddev() |
double |
logpdf(double val)
Return the log density of an existing value
|
static double |
logpdf(double x,
double mu,
double sigma)
Log probability density function of the normal distribution.
|
double |
nextRandom()
Generate a new random value
|
double |
pdf(double val)
Return the density of an existing value
|
static double |
pdf(double x,
double mu,
double sigma)
Probability density function of the normal distribution.
|
double |
quantile(double q)
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
|
static double |
quantile(double x,
double mu,
double sigma)
Inverse cumulative probability density function (probit) of a normal
distribution.
|
static double |
standardNormalCDF(double x)
Cumulative probability density function (CDF) of a normal distribution.
|
static double |
standardNormalLogPDF(double x)
Log probability density function of the standard normal distribution.
|
static double |
standardNormalPDF(double x)
Probability density function of the standard normal distribution.
|
static double |
standardNormalQuantile(double d)
Approximate the inverse error function for normal distributions.
|
java.lang.String |
toString()
Describe the distribution
|
static final double P_LOW
static final double P_HIGH
public static final double PHIINV075
public static final double ONEBYPHIINV075
private double mean
private double stddev
private static final double[] ERF_COEFF1
private static final double[] ERF_COEFF2
public NormalDistribution(double mean,
double stddev,
RandomFactory random)
mean - Meanstddev - Standard Deviationrandom - Random generatorpublic NormalDistribution(double mean,
double stddev,
java.util.Random random)
mean - Meanstddev - Standard Deviationrandom - Random generatorpublic NormalDistribution(double mean,
double stddev)
mean - Meanstddev - Standard Deviationpublic double pdf(double val)
Distributionval - existing valuepublic double logpdf(double val)
Distributionval - existing valuepublic double cdf(double val)
Distributionval - existing valuepublic double quantile(double q)
Distributionq - Quantile to findpublic double nextRandom()
DistributionnextRandom in interface DistributionnextRandom in class AbstractDistributionpublic java.lang.String toString()
DistributiontoString in interface DistributiontoString in class java.lang.Objectpublic double getMean()
public double getStddev()
@Reference(authors="T. Ooura", title="Gamma / Error Functions", booktitle="", url="http://www.kurims.kyoto-u.ac.jp/~ooura/gamerf.html", bibkey="web/Ooura96") public static double erfc(double x)
Based on:
Takuya Ooura, http://www.kurims.kyoto-u.ac.jp/~ooura/gamerf.html
Copyright (C) 1996 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
"You may use, copy, modify this code for any purpose and without fee."
x - parameter valuepublic static double erf(double x)
x - parameter value@Reference(authors="T. Ooura", title="Gamma / Error Functions", booktitle="", url="http://www.kurims.kyoto-u.ac.jp/~ooura/gamerf.html", bibkey="web/Ooura96") public static double erfcinv(double y)
Based on:
T. Ooura, http://www.kurims.kyoto-u.ac.jp/~ooura/gamerf.html
Copyright (C) 1996 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
"You may use, copy, modify this code for any purpose and without fee."
y - parameter valuepublic static double pdf(double x,
double mu,
double sigma)
\[ \frac{1}{\sqrt{2\pi\sigma^2}} \exp(-\frac{(x-\mu)^2}{2\sigma^2}) \]
x - The value.mu - The mean.sigma - The standard deviation.public static double logpdf(double x,
double mu,
double sigma)
\[\log\frac{1}{\sqrt{2\pi}} - \log\sigma - \tfrac{(x-\mu)^2}{2\sigma^2}\]
x - The value.mu - The mean.sigma - The standard deviation.public static double standardNormalLogPDF(double x)
\[ \log\frac{1}{\sqrt{2\pi}} -\frac{x^2}{2}) \]
x - The value.public static double standardNormalPDF(double x)
\[ \frac{1}{\sqrt{2\pi}} \exp(-\frac{x^2}{2}) \]
x - The value.@Reference(authors="G. Marsaglia", title="Evaluating the Normal Distribution", booktitle="Journal of Statistical Software 11(4)", url="https://doi.org/10.18637/jss.v011.i04", bibkey="doi:10.18637/jss.v011.i04") public static double cdf(double x, double mu, double sigma)
Reference:
G. Marsaglia
Evaluating the Normal Distribution
Journal of Statistical Software 11(4)
x - value to evaluate CDF atmu - Mean valuesigma - Standard deviation.@Reference(authors="G. Marsaglia", title="Evaluating the Normal Distribution", booktitle="Journal of Statistical Software 11(4)", url="https://doi.org/10.18637/jss.v011.i04", bibkey="doi:10.18637/jss.v011.i04") public static double standardNormalCDF(double x)
Reference:
G. Marsaglia
Evaluating the Normal Distribution
Journal of Statistical Software 11(4)
x - value to evaluate CDF atpublic static double quantile(double x,
double mu,
double sigma)
x - value to evaluate probit function atmu - Mean valuesigma - Standard deviation.public static double standardNormalQuantile(double d)
d - Quantile. Must be in [0:1], obviously.Copyright © 2019 ELKI Development Team. License information.