gov.sandia.cognition.statistics.distribution
Class DeterministicDistribution

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.distribution.DeterministicDistribution
All Implemented Interfaces:
Vectorizable, ClosedFormComputableDistribution<Double>, ClosedFormDiscreteUnivariateDistribution<Double>, ClosedFormDistribution<Double>, ClosedFormUnivariateDistribution<Double>, ComputableDistribution<Double>, DiscreteDistribution<Double>, Distribution<Double>, DistributionWithMean<Double>, UnivariateDistribution<Double>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
DeterministicDistribution.CDF, DeterministicDistribution.PMF

@PublicationReference(author="Wikipedia",
                      title="Degenerate distribution",
                      type=WebPage,
                      year=2009,
                      url="http://en.wikipedia.org/wiki/Degenerate_distribution")
public class DeterministicDistribution
extends AbstractClosedFormUnivariateDistribution<Double>
implements ClosedFormDiscreteUnivariateDistribution<Double>

A deterministic distribution that returns samples at a single point. This is also known as a degenerate distribution.

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

Nested Class Summary
static class DeterministicDistribution.CDF
          CDF of the deterministic distribution.
static class DeterministicDistribution.PMF
          PMF of the deterministic distribution.
 
Field Summary
static double DEFAULT_POINT
          Default point, 0.0
 
Constructor Summary
DeterministicDistribution()
          Creates a new instance of DeterministicDistribution
DeterministicDistribution(DeterministicDistribution other)
          Copy Constructor
DeterministicDistribution(double point)
          Creates a new instance of DeterministicDistribution
 
Method Summary
 void convertFromVector(Vector parameters)
          Converts the object from a Vector of parameters.
 Vector convertToVector()
          Converts the object to a vector.
 DeterministicDistribution.CDF getCDF()
          Gets the CDF of a scalar distribution.
 Set<Double> getDomain()
          Returns an object that allows an iteration through the domain (x-axis, independent variable) of the Distribution
 int getDomainSize()
          Gets the size of the domain.
 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.
 double getPoint()
          Getter for point
 DeterministicDistribution.PMF getProbabilityFunction()
          Gets the distribution function associated with this Distribution, either the PDF or PMF.
 double getVariance()
          Gets the variance of the distribution.
 ArrayList<Double> sample(Random random, int numSamples)
          Draws multiple random samples from the distribution.
 void setPoint(double point)
          Setter for point
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractClosedFormUnivariateDistribution
clone
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDistribution
sample
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample
 
Methods inherited from interface gov.sandia.cognition.math.matrix.Vectorizable
clone
 

Field Detail

DEFAULT_POINT

public static final double DEFAULT_POINT
Default point, 0.0

See Also:
Constant Field Values
Constructor Detail

DeterministicDistribution

public DeterministicDistribution()
Creates a new instance of DeterministicDistribution


DeterministicDistribution

public DeterministicDistribution(double point)
Creates a new instance of DeterministicDistribution

Parameters:
point - Location of the distribution

DeterministicDistribution

public DeterministicDistribution(DeterministicDistribution other)
Copy Constructor

Parameters:
other - DeterministicDistribution to copy
Method Detail

getPoint

public double getPoint()
Getter for point

Returns:
Location of the distribution

setPoint

public void setPoint(double point)
Setter for point

Parameters:
point - Location of the distribution

getMean

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

Specified by:
getMean in interface DistributionWithMean<Double>
Returns:
Mean of the distribution.

sample

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

Specified by:
sample in interface Distribution<Double>
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.

Specified by:
convertToVector in interface Vectorizable
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.

Specified by:
convertFromVector in interface Vectorizable
Parameters:
parameters - The parameters to incorporate.

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.

Specified by:
getVariance in interface UnivariateDistribution<Double>
Returns:
Variance of the distribution.

getCDF

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

Specified by:
getCDF in interface ClosedFormUnivariateDistribution<Double>
Specified by:
getCDF in interface UnivariateDistribution<Double>
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.

Specified by:
getMinSupport in interface UnivariateDistribution<Double>
Returns:
Minimum support.

getMaxSupport

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

Specified by:
getMaxSupport in interface UnivariateDistribution<Double>
Returns:
Minimum support.

getDomain

public Set<Double> getDomain()
Description copied from interface: DiscreteDistribution
Returns an object that allows an iteration through the domain (x-axis, independent variable) of the Distribution

Specified by:
getDomain in interface DiscreteDistribution<Double>
Returns:
Collection that enumerates each value that the domain can take

getDomainSize

public int getDomainSize()
Description copied from interface: DiscreteDistribution
Gets the size of the domain.

Specified by:
getDomainSize in interface DiscreteDistribution<Double>
Returns:
The size of the domain.

getProbabilityFunction

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

Specified by:
getProbabilityFunction in interface ComputableDistribution<Double>
Specified by:
getProbabilityFunction in interface DiscreteDistribution<Double>
Returns:
Distribution function associated with this Distribution.