javanpst.distributions.common.continuous
Class LaplaceDistribution
- java.lang.Object
-
- javanpst.distributions.common.continuous.LaplaceDistribution
-
- All Implemented Interfaces:
- Distribution
public class LaplaceDistribution extends java.lang.Object implements Distribution
A Laplace distribution.
-
-
Constructor Summary
Constructors Constructor and Description LaplaceDistribution()Default builder.LaplaceDistribution(double mean, double scale)Builder.LaplaceDistribution(LaplaceDistribution old)Copy constructor Creates a copy of a given Laplace distribution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecomputeCumulativeProbability(double x)Computes cumulative probability at a given point of the Laplace distribution.doublecomputeProbability(double x)Computes mass probability at a given point of the Laplace distribution.doublegetMean()Gets the mean parameterdoublegetScale()Gets the scale parametervoidsetMean(double value)Sets meanvoidsetScale(double value)Sets scale Scale value must be positivejava.lang.StringtoString()To String method.
-
-
-
Constructor Detail
-
LaplaceDistribution
public LaplaceDistribution()
Default builder. Creates a Laplace distribution with mean 0.0 and scale 1.0
-
LaplaceDistribution
public LaplaceDistribution(double mean, double scale)Builder. Creates a Laplace distribution with specified mean and scale Scale must be positive- Parameters:
mean- mean of the distributionscale- scale of the distribution
-
LaplaceDistribution
public LaplaceDistribution(LaplaceDistribution old)
Copy constructor Creates a copy of a given Laplace distribution- Parameters:
old- Laplace distribution to copy
-
-
Method Detail
-
setMean
public void setMean(double value)
Sets mean- Parameters:
value- mean value
-
setScale
public void setScale(double value)
Sets scale Scale value must be positive- Parameters:
value- scale value
-
getMean
public double getMean()
Gets the mean parameter- Returns:
- value of mean
-
getScale
public double getScale()
Gets the scale parameter- Returns:
- value of scale
-
computeProbability
public double computeProbability(double x)
Computes mass probability at a given point of the Laplace distribution.- Specified by:
computeProbabilityin interfaceDistribution- Parameters:
x- point selected- Returns:
- mass probability at 'x'
-
computeCumulativeProbability
public double computeCumulativeProbability(double x)
Computes cumulative probability at a given point of the Laplace distribution.- Specified by:
computeCumulativeProbabilityin interfaceDistribution- Parameters:
x- point selected- Returns:
- cumulative probability at 'x'
-
toString
public java.lang.String toString()
To String method.- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation of the distribution
-
-
DMelt 3.0 © DataMelt by jWork.ORG