public class LocationScaleDistribution extends Distribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
LocationScaleDistribution()
This default constructor creates a new location-scale distribution
on the normal distribution with location parameter 0 and scale
parameter 1.
|
LocationScaleDistribution(Distribution d,
double a,
double b)
This general constructor creates a new location-scale transformation on
a given distribuiton with given location and scale parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
getCDF(double x)
This method returns the cumulative distribution function of the location-
scale distribution in terms of the CDF of the given distribution and the
location and scale parameters.
|
double |
getDensity(double x)
This method computes the probability density function of the
location-scale distribution in terms of the location
and scale parameters and the density function of the given distribution.
|
Distribution |
getDistribution()
This method gets the underlying distribution that is being moved and scaled.
|
double |
getLocation()
This method returns the location parameter.
|
double |
getMaxDensity()
This method returns the maximum value of the probability density function of the
location-scale distribution, which is the same as the maximum value of the
probability density function of the given distribution.
|
double |
getMean()
This mtehod computes the mean of the location-scale distribution in terms
of the mean of the given distribution and the location and scale parameters.
|
double |
getQuantile(double p)
This method returns the quantile function of the location-scale
distribution in terms of the quantile function of the given distribution
and the location and scale parameters.
|
double |
getScale()
This method gets the scale parameter
|
double |
getVariance()
This method returns the variance of the location-scale distribution
in terms of the given distribution and the location and scale parameters.
|
void |
setDistribution(Distribution d)
This method sets the distribution to be moved and scaled.
|
void |
setLocation(double a)
This method sets the location parameter.
|
void |
setParameters(Distribution d,
double a,
double b)
This method sets the parameters, the distribution and the location and
scale parameters, and sets up the domain.
|
void |
setScale(double b)
This method sets the scale parameter.
|
double |
simulate()
This method returns a simulated value from the location-scale distribution
in terms of the given distribution and the location and scale parameters.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
public LocationScaleDistribution(Distribution d, double a, double b)
d
- the distributiona
- the location parameterb
- the scale parameterpublic LocationScaleDistribution()
public void setParameters(Distribution d, double a, double b)
d
- the distributiona
- the location parameterb
- the scale parameterpublic double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distributionpublic double getMaxDensity()
getMaxDensity
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public double simulate()
simulate
in class Distribution
public double getCDF(double x)
getCDF
in class Distribution
x
- a number in the domain of the distributionpublic double getQuantile(double p)
getQuantile
in class Distribution
p
- a probability in (0, 1)public void setLocation(double a)
a
- the location parameterpublic double getLocation()
public void setScale(double b)
b
- the scale parameterpublic double getScale()
public void setDistribution(Distribution d)
d
- the distributionpublic Distribution getDistribution()
public java.lang.String toString()
toString
in class Distribution