public class NormalDistribution extends Distribution implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static double |
SQRT2PI |
CONTINUOUS, DISCRETE, MIXED| Constructor and Description |
|---|
NormalDistribution()
This default constructor creates a new standard normal distribution (with
location parameter 0 and scale parameter 1).
|
NormalDistribution(double m,
double s)
This general constructor creates a new normal distribution with specified
parameter values.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getCDF(double x)
This method computes the cumulative distribution function.
|
double |
getCentralMoment(int n)
This method computes the central moment of a specifed order.
|
double |
getDensity(double x)
This method defines the probability density function.
|
double |
getLocation()
This method returns the location parameter.
|
double |
getMaxDensity()
This method returns the maximum value of the density function.
|
double |
getMean()
This method returns the mean, which is the same as the location parameter.
|
double |
getMedian()
This method returns the median, which is the same as the location parameter.
|
double |
getMGF(double t)
This method returns the moment generating function.
|
double |
getMoment(double a,
int n)
This method computes the moment of a specified order about a specified point.
|
double |
getScale()
This method gets the scale parameter.
|
double |
getVariance()
This method returns the variance of the distribution.
|
void |
setLocation(double m)
This method sets the location parameter.
|
void |
setParameters(double m,
double s)
This method sets the parameters and defines the default domain.
|
void |
setScale(double s)
This method sets the scale parameter.
|
double |
simulate()
This method simulates a value from the distribution.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getDomain, getFailureRate, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomainpublic NormalDistribution(double m,
double s)
m - the location parameters - the scale parameterpublic NormalDistribution()
public void setParameters(double m,
double s)
m - the location parameters - the scale parameterpublic double getDensity(double x)
getDensity in class Distributionx - a number in the domain of the distributionpublic double getMaxDensity()
getMaxDensity in class Distributionpublic double getMedian()
getMedian in class Distributionpublic double getMean()
getMean in class Distributionpublic double getVariance()
getVariance in class Distributionpublic double getCentralMoment(int n)
n - the orderpublic double getMoment(double a,
int n)
getMoment in class Distributiona - the centern - the orderpublic double getMGF(double t)
getMGF in class Distributiont - a real numberpublic double simulate()
simulate in class Distributionpublic double getLocation()
public void setLocation(double m)
m - the location parameterpublic double getScale()
public void setScale(double s)
s - the scale parameterpublic double getCDF(double x)
getCDF in class Distributionx - a number in the domain of the distributionpublic java.lang.String toString()
toString in class Distribution