javanpst.distributions.common.continuous
Class ExponentialDistribution
- java.lang.Object
-
- javanpst.distributions.common.continuous.ExponentialDistribution
-
- All Implemented Interfaces:
- Distribution
public final class ExponentialDistribution extends java.lang.Object implements Distribution
A exponential distribution.
-
-
Constructor Summary
Constructors Constructor and Description ExponentialDistribution()Default builder.ExponentialDistribution(double lambda)Builder.ExponentialDistribution(ExponentialDistribution old)Copy constructor Creates a copy of a given exponential 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 exponential distribution.doublecomputeProbability(double x)Computes mass probability at a given point of the exponential distribution.doublegetLambda()Gets lambda parameterdoublegetMean()Gets mean of the distribution (mean = 1/lambda)voidsetLambda(double value)Sets lambda parametervoidsetMean(double value)Sets mean of the distribution (mean = 1/lambda)java.lang.StringtoString()To String method.
-
-
-
Constructor Detail
-
ExponentialDistribution
public ExponentialDistribution()
Default builder. Creates a exponential distribution with lambda = 1
-
ExponentialDistribution
public ExponentialDistribution(double lambda)
Builder. Creates a exponential distribution with specified lambda- Parameters:
lambda- lambda parameer of the distribution
-
ExponentialDistribution
public ExponentialDistribution(ExponentialDistribution old)
Copy constructor Creates a copy of a given exponential distribution- Parameters:
old- exponential distribution to copy
-
-
Method Detail
-
setLambda
public void setLambda(double value)
Sets lambda parameter- Parameters:
value- value for the lambda parameter
-
setMean
public void setMean(double value)
Sets mean of the distribution (mean = 1/lambda)- Parameters:
value- value for the mean
-
getMean
public double getMean()
Gets mean of the distribution (mean = 1/lambda)- Returns:
- mean of the distribution
-
getLambda
public double getLambda()
Gets lambda parameter- Returns:
- lambda value
-
computeProbability
public double computeProbability(double x)
Computes mass probability at a given point of the exponential 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 exponential 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