gov.sandia.cognition.statistics.distribution
Class ParetoDistribution

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.AbstractDistribution<NumberType>
          extended by gov.sandia.cognition.statistics.AbstractClosedFormUnivariateDistribution<Double>
              extended by gov.sandia.cognition.statistics.AbstractClosedFormSmoothUnivariateDistribution
                  extended by gov.sandia.cognition.statistics.distribution.ParetoDistribution
All Implemented Interfaces:
Vectorizable, ClosedFormComputableDistribution<Double>, ClosedFormDistribution<Double>, ClosedFormUnivariateDistribution<Double>, ComputableDistribution<Double>, Distribution<Double>, DistributionWithMean<Double>, SmoothUnivariateDistribution, UnivariateDistribution<Double>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
ParetoDistribution.CDF, ParetoDistribution.PDF

@PublicationReference(author="Wikipedia",
                      title="Normal distribution",
                      type=WebPage,
                      year=2010,
                      url="http://en.wikipedia.org/wiki/Pareto_distribution")
public class ParetoDistribution
extends AbstractClosedFormSmoothUnivariateDistribution

This class describes the Pareto distribution, sometimes called the Bradford Distribution. The Pareto distribution tends to be used to model social phenomena, such as the distribution of wealth in a society, price returns of stocks, file sizes on a computer, etc. It encapsulates the notion that there are few large entities and many smaller ones (80 percent of the wealth is controlled by 20 percent of the population).

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
static class ParetoDistribution.CDF
          CDF of the Pareto Distribution.
static class ParetoDistribution.PDF
          PDF of the ParetoDistribution
 
Field Summary
static double DEFALUT_SCALE
          Default scale, 1.0.
static double DEFAULT_SHAPE
          Default shape, 2.0.
static double DEFAULT_SHIFT
          Default shift, 0.0.
protected  double scale
          Scale parameter, must be greater than zero.
protected  double shape
          Scale parameter, must be greater than zero.
protected  double shift
          Amount to shift the distribution to the left.
 
Constructor Summary
ParetoDistribution()
          Creates a new instance of ParetoDistribution
ParetoDistribution(double shape, double scale, double shift)
          Creates a new instance of ParetoDistribution
ParetoDistribution(ParetoDistribution other)
          Copy constructor
 
Method Summary
 ParetoDistribution clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 void convertFromVector(Vector parameters)
          Converts the object from a Vector of parameters.
 Vector convertToVector()
          Converts the object to a vector.
 ParetoDistribution.CDF getCDF()
          Gets the CDF of a scalar distribution.
 Double getMaxSupport()
          Gets the minimum support (domain or input) of the distribution.
 Double getMean()
          Gets the arithmetic mean, or "first central moment" or "expectation", of the distribution.
 Double getMinSupport()
          Gets the minimum support (domain or input) of the distribution.
 ParetoDistribution.PDF getProbabilityFunction()
          Gets the distribution function associated with this Distribution, either the PDF or PMF.
 double getScale()
          Getter for scale.
 double getShape()
          Getter for shape
 double getVariance()
          Gets the variance of the distribution.
 ArrayList<? extends Double> sample(Random random, int numSamples)
          Draws multiple random samples from the distribution.
 void setScale(double scale)
          Setter for scale
 void setShape(double shape)
          Setter for shape
 void setShift(double shift)
          Setter for shift.
 String toString()
           
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDistribution
sample
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample
 

Field Detail

DEFAULT_SHAPE

public static final double DEFAULT_SHAPE
Default shape, 2.0.

See Also:
Constant Field Values

DEFALUT_SCALE

public static final double DEFALUT_SCALE
Default scale, 1.0.

See Also:
Constant Field Values

DEFAULT_SHIFT

public static final double DEFAULT_SHIFT
Default shift, 0.0.

See Also:
Constant Field Values

shape

protected double shape
Scale parameter, must be greater than zero.


scale

protected double scale
Scale parameter, must be greater than zero.


shift

protected double shift
Amount to shift the distribution to the left.

Constructor Detail

ParetoDistribution

public ParetoDistribution()
Creates a new instance of ParetoDistribution


ParetoDistribution

public ParetoDistribution(double shape,
                          double scale,
                          double shift)
Creates a new instance of ParetoDistribution

Parameters:
shape - Scale parameter, must be greater than zero.
scale - Scale parameter, must be greater than zero.
shift - Amount to shift the distribution to the left.

ParetoDistribution

public ParetoDistribution(ParetoDistribution other)
Copy constructor

Parameters:
other - ParetoDistribution to copy
Method Detail

clone

public ParetoDistribution clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface Vectorizable
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractClosedFormUnivariateDistribution<Double>
Returns:
A clone of this object.

getShape

public double getShape()
Getter for shape

Returns:
Shape parameter, must be greater than zero.

setShape

public void setShape(double shape)
Setter for shape

Parameters:
shape - Shape parameter, must be greater than zero.

getScale

public double getScale()
Getter for scale.

Returns:
Scale parameter, must be greater than zero.

setScale

public void setScale(double scale)
Setter for scale

Parameters:
scale - Scale parameter, must be greater than zero.

getMean

public Double getMean()
Description copied from interface: DistributionWithMean
Gets the arithmetic mean, or "first central moment" or "expectation", of the distribution.

Returns:
Mean of the distribution.

getVariance

public double getVariance()
Description copied from interface: UnivariateDistribution
Gets the variance of the distribution. This is sometimes called the second central moment by more pedantic people, which is equivalent to the square of the standard deviation.

Returns:
Variance of the distribution.

sample

public ArrayList<? extends Double> sample(Random random,
                                          int numSamples)
Description copied from interface: Distribution
Draws multiple random samples from the distribution. It is generally more efficient to use this multiple-sample method than multiple calls of the single-sample method. (But not always.)

Parameters:
random - Random-number generator to use in order to generate random numbers.
numSamples - Number of samples to draw from the distribution.
Returns:
Samples drawn according to this distribution.

convertToVector

public Vector convertToVector()
Description copied from interface: Vectorizable
Converts the object to a vector.

Returns:
The Vector form of the object.

convertFromVector

public void convertFromVector(Vector parameters)
Description copied from interface: Vectorizable
Converts the object from a Vector of parameters.

Parameters:
parameters - The parameters to incorporate.

getProbabilityFunction

public ParetoDistribution.PDF getProbabilityFunction()
Description copied from interface: ComputableDistribution
Gets the distribution function associated with this Distribution, either the PDF or PMF.

Returns:
Distribution function associated with this Distribution.

getCDF

public ParetoDistribution.CDF getCDF()
Description copied from interface: UnivariateDistribution
Gets the CDF of a scalar distribution.

Returns:
CDF of the scalar distribution.

getMinSupport

public Double getMinSupport()
Description copied from interface: UnivariateDistribution
Gets the minimum support (domain or input) of the distribution.

Returns:
Minimum support.

getMaxSupport

public Double getMaxSupport()
Description copied from interface: UnivariateDistribution
Gets the minimum support (domain or input) of the distribution.

Returns:
Minimum support.

toString

public String toString()
Overrides:
toString in class Object

setShift

public void setShift(double shift)
Setter for shift.

Parameters:
shift - Amount to shift the distribution to the left.