|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.statistics.AbstractDistribution<NumberType>
gov.sandia.cognition.statistics.AbstractClosedFormUnivariateDistribution<Double>
gov.sandia.cognition.statistics.AbstractClosedFormSmoothUnivariateDistribution
gov.sandia.cognition.statistics.distribution.LaplaceDistribution
@PublicationReference(author="Wikipedia",
title="Laplace distribution",
type=WebPage,
year=2009,
url="http://en.wikipedia.org/wiki/Laplace_distribution")
public class LaplaceDistributionA Laplace distribution, sometimes called a double exponential distribution. This distribution arrises when evaluating the difference between two iid exponential random variables, or when sampling Brownian motion at exponentially distributed time steps.
| Nested Class Summary | |
|---|---|
static class |
LaplaceDistribution.CDF
CDF of the Laplace distribution. |
static class |
LaplaceDistribution.MaximumLikelihoodEstimator
Estimates the ML parameters of a Laplace distribution from a Collection of Numbers. |
static class |
LaplaceDistribution.PDF
The PDF of a Laplace Distribution. |
static class |
LaplaceDistribution.WeightedMaximumLikelihoodEstimator
Creates a UnivariateGaussian from weighted data |
| Field Summary | |
|---|---|
static double |
DEFAULT_MEAN
Default mean, 0.0. |
static double |
DEFAULT_SCALE
Default scale, 1.0. |
protected double |
mean
Mean of the distribution |
protected double |
scale
Scale factor of the distribution, must be greater than zero. |
| Constructor Summary | |
|---|---|
LaplaceDistribution()
Creates a new instance of LaplaceDistribution |
|
LaplaceDistribution(double mean,
double scale)
Creates a new instance of LaplaceDistribution |
|
LaplaceDistribution(LaplaceDistribution other)
Copy Constructor |
|
| Method Summary | |
|---|---|
LaplaceDistribution |
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. |
LaplaceDistribution.CDF |
getCDF()
Gets the CDF of a scalar distribution. |
LaplaceDistribution.MaximumLikelihoodEstimator |
getEstimator()
Gets an estimator associated with this 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. |
LaplaceDistribution.PDF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution, either the PDF or PMF. |
double |
getScale()
Getter for scale |
double |
getVariance()
Gets the variance of the distribution. |
ArrayList<Double> |
sample(Random random,
int numSamples)
Draws multiple random samples from the distribution. |
void |
setMean(double mean)
Setter for mean |
void |
setScale(double scale)
Setter for scale |
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 |
|---|
public static final double DEFAULT_MEAN
public static final double DEFAULT_SCALE
protected double mean
protected double scale
| Constructor Detail |
|---|
public LaplaceDistribution()
public LaplaceDistribution(double mean,
double scale)
mean - Mean of the distributionscale - Scale factor of the distribution, must be greater than zero.public LaplaceDistribution(LaplaceDistribution other)
other - LaplaceDistribution to copy| Method Detail |
|---|
public LaplaceDistribution clone()
AbstractCloneableSerializableObject 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.
clone in interface Vectorizableclone in interface CloneableSerializableclone in class AbstractClosedFormUnivariateDistribution<Double>public Double getMean()
DistributionWithMean
getMean in interface DistributionWithMean<Double>getMean in interface SmoothUnivariateDistributionpublic void setMean(double mean)
mean - Mean of the distributionpublic double getScale()
public void setScale(double scale)
scale - Scale factor of the distribution, must be greater than zero.
public ArrayList<Double> sample(Random random,
int numSamples)
Distribution
sample in interface Distribution<Double>random - Random-number generator to use in order to generate random numbers.numSamples - Number of samples to draw from the distribution.
public Vector convertToVector()
Vectorizable
convertToVector in interface Vectorizablepublic void convertFromVector(Vector parameters)
Vectorizable
convertFromVector in interface Vectorizableparameters - The parameters to incorporate.public double getVariance()
UnivariateDistribution
getVariance in interface UnivariateDistribution<Double>public String toString()
toString in class Objectpublic LaplaceDistribution.CDF getCDF()
UnivariateDistribution
getCDF in interface ClosedFormUnivariateDistribution<Double>getCDF in interface SmoothUnivariateDistributiongetCDF in interface UnivariateDistribution<Double>public LaplaceDistribution.PDF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction in interface ComputableDistribution<Double>getProbabilityFunction in interface SmoothUnivariateDistributionpublic Double getMinSupport()
UnivariateDistribution
getMinSupport in interface UnivariateDistribution<Double>public Double getMaxSupport()
UnivariateDistribution
getMaxSupport in interface UnivariateDistribution<Double>public LaplaceDistribution.MaximumLikelihoodEstimator getEstimator()
EstimableDistribution
getEstimator in interface EstimableDistribution<Double,LaplaceDistribution>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||