org.jscience.mathematics.statistics
Class ConvolutionDistribution

java.lang.Object
  extended by org.jscience.mathematics.statistics.Distribution
      extended by org.jscience.mathematics.statistics.ConvolutionDistribution
All Implemented Interfaces:
java.io.Serializable

public class ConvolutionDistribution
extends Distribution
implements java.io.Serializable

This class creates covolution of a given distribution to a given power.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
ConvolutionDistribution()
          This defalut constructor creates a new convolution distribution corrrepsonding to the uniform distribution on (0,1), with convolution power 5.
ConvolutionDistribution(Distribution d, int n)
          This general constructor: creates a new convolution distribution corresponding to a specified distribution and convolution power.
 
Method Summary
 double getDensity(double x)
          This method computes the probability density function.
 Distribution getDistribution()
          This method returns the distribution.
 double getMean()
          This method computes the mean of the convolution distribution in terms of the mean of the given distribution and the convolution power.
 double getMGF(double t)
          This method computes the moment generating function of the convolution distribution in terms of the moment generating function of the given distribution and the convolution power.
 int getPower()
          This method returns the convolution power.
 double getVariance()
          This method computes the variance of the convolution distribution in terms of the variance of the given distribution and the convolution power.
 void setDistribution(Distribution d)
          This method sets the distribution.
 void setParameters(Distribution d, int n)
          This method sets the parameters: the distribution and convolution power.
 void setPower(int n)
          This method sets the convolution power.
 double simulate()
          This method simulates a value from the convolution distribution by computing a sum of simulated values from the given distribuiton.
 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 org.jscience.mathematics.statistics.Distribution
getCDF, getDomain, getFailureRate, getMaxDensity, getMedian, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConvolutionDistribution

public ConvolutionDistribution(Distribution d,
                               int n)
This general constructor: creates a new convolution distribution corresponding to a specified distribution and convolution power.

Parameters:
d - the distribution
n - the covolution power

ConvolutionDistribution

public ConvolutionDistribution()
This defalut constructor creates a new convolution distribution corrrepsonding to the uniform distribution on (0,1), with convolution power 5.

Method Detail

setParameters

public void setParameters(Distribution d,
                          int n)
This method sets the parameters: the distribution and convolution power. The method computes and stores the values of the probability density function.

Parameters:
d - the distribution
n - the covolution power

getDensity

public double getDensity(double x)
This method computes the probability density function.

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

getMean

public double getMean()
This method computes the mean of the convolution distribution in terms of the mean of the given distribution and the convolution power.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method computes the variance of the convolution distribution in terms of the variance of the given distribution and the convolution power.

Overrides:
getVariance in class Distribution
Returns:
the variance

getMGF

public double getMGF(double t)
This method computes the moment generating function of the convolution distribution in terms of the moment generating function of the given distribution and the convolution power.

Overrides:
getMGF in class Distribution
Parameters:
t - a real number
Returns:
the moment generating function at t

simulate

public double simulate()
This method simulates a value from the convolution distribution by computing a sum of simulated values from the given distribuiton.

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

setPower

public void setPower(int n)
This method sets the convolution power.

Parameters:
n - the convolution power

getPower

public int getPower()
This method returns the convolution power.

Returns:
the convolution power

setDistribution

public void setDistribution(Distribution d)
This method sets the distribution.

Parameters:
d - the distribution to be convolved

getDistribution

public Distribution getDistribution()
This method returns the distribution.

Returns:
the distribution to be convolved

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