edu.uah.math.distributions
Class LocationScaleDistribution

java.lang.Object
  extended by edu.uah.math.distributions.Distribution
      extended by edu.uah.math.distributions.LocationScaleDistribution
All Implemented Interfaces:
java.io.Serializable

public class LocationScaleDistribution
extends Distribution
implements java.io.Serializable

This class applies a location-scale tranformation to a given distribution. In terms of the corresponding random variable X, the transformation is Y = a + bX.

Version:
August, 2003
Author:
Kyle Siegrist, Dawn Duehring
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.uah.math.distributions.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class edu.uah.math.distributions.Distribution
getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationScaleDistribution

public 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.

Parameters:
d - the distribution
a - the location parameter
b - the scale parameter

LocationScaleDistribution

public LocationScaleDistribution()
This default constructor creates a new location-scale distribution on the normal distribution with location parameter 0 and scale parameter 1. Of course, this is simply the standard normal distribution.

Method Detail

setParameters

public 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.

Parameters:
d - the distribution
a - the location parameter
b - the scale parameter

getDensity

public 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.

Specified by:
getDensity in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the probability density function of x.

getMaxDensity

public 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.

Overrides:
getMaxDensity in class Distribution
Returns:
the maximum value of the probability density function

getMean

public 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.

Overrides:
getMean in class Distribution
Returns:
the mean of the distribution

getVariance

public double getVariance()
This method returns the variance of the location-scale distribution in terms of the given distribution and the location and scale parameters.

Overrides:
getVariance in class Distribution
Returns:
the variance of the distribution

simulate

public 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.

Overrides:
simulate in class Distribution
Returns:
a simulated value from the distribution

getCDF

public 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.

Overrides:
getCDF in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the cumulative probability at x

getQuantile

public 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.

Overrides:
getQuantile in class Distribution
Parameters:
p - a probability in (0, 1)
Returns:
the quanitle of order p

setLocation

public void setLocation(double a)
This method sets the location parameter.

Parameters:
a - the location parameter

getLocation

public double getLocation()
This method returns the location parameter.

Returns:
the location parameter

setScale

public void setScale(double b)
This method sets the scale parameter.

Parameters:
b - the scale parameter

getScale

public double getScale()
This method gets the scale parameter

Returns:
the scale parameter

setDistribution

public void setDistribution(Distribution d)
This method sets the distribution to be moved and scaled.

Parameters:
d - the distribution

getDistribution

public Distribution getDistribution()
This method gets the underlying distribution that is being moved and scaled.

Returns:
the distribution

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class Distribution
Returns:
a string giving the name of the distribution and the values of the parameters