javanpst.distributions.common.continuous
Class GammaDistribution
- java.lang.Object
-
- javanpst.distributions.common.continuous.GammaDistribution
-
- All Implemented Interfaces:
- Distribution
public final class GammaDistribution extends java.lang.Object implements Distribution
A Gamma distribution.
-
-
Constructor Summary
Constructors Constructor and Description GammaDistribution()Default builder.GammaDistribution(double alpha, double beta)Builder.GammaDistribution(GammaDistribution old)Copy constructor Creates a copy of a given gamma distribution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecomputeCumulativeProbability(double value)Computes cumulative probability at a given point of the gamma distribution.doublecomputeProbability(double value)Computes mass probability at a given point of the gamma distribution.doublegetAlpha()Gets the alpha parameterdoublegetBeta()Gets the beta parameterdoublegetK()Gets the K parameter (an alias of alpha)doublegetLambda()Gets the lambda parameter (an alias of 1/beta)doubleregularizedGammaP(double a, double x)Computes regularized gamma P functiondoubleregularizedGammaQ(double a, double x)Computes regularized gamma Q functionvoidsetAlpha(double value)Sets alpha value Value must be positivevoidsetBeta(double value)Sets beta value Value must be positivevoidsetK(double value)Sets K value (an alias of alpha) Value must be positivevoidsetLambda(double value)Sets lambda value (an alias of (1/beta)) Value must be positivejava.lang.StringtoString()To String method.
-
-
-
Constructor Detail
-
GammaDistribution
public GammaDistribution()
Default builder. Creates a chi-square distribution with 1 degree of freedom
-
GammaDistribution
public GammaDistribution(double alpha, double beta)Builder. Creates a gamma distribution with specified values of alpha and beta- Parameters:
alpha-beta-
-
GammaDistribution
public GammaDistribution(GammaDistribution old)
Copy constructor Creates a copy of a given gamma distribution- Parameters:
old- uniform distribution to copy
-
-
Method Detail
-
setAlpha
public void setAlpha(double value)
Sets alpha value Value must be positive- Parameters:
value- alpha value
-
setK
public void setK(double value)
Sets K value (an alias of alpha) Value must be positive- Parameters:
value- alpha value
-
setBeta
public void setBeta(double value)
Sets beta value Value must be positive- Parameters:
value- alpha value
-
setLambda
public void setLambda(double value)
Sets lambda value (an alias of (1/beta)) Value must be positive- Parameters:
value- alpha value
-
getAlpha
public double getAlpha()
Gets the alpha parameter- Returns:
- value of alpha
-
getK
public double getK()
Gets the K parameter (an alias of alpha)- Returns:
- value of K
-
getBeta
public double getBeta()
Gets the beta parameter- Returns:
- value of beta
-
getLambda
public double getLambda()
Gets the lambda parameter (an alias of 1/beta)- Returns:
- value of lambda
-
computeProbability
public double computeProbability(double value)
Computes mass probability at a given point of the gamma distribution.- Specified by:
computeProbabilityin interfaceDistribution- Parameters:
value- point selected- Returns:
- mass probability at 'value'
-
computeCumulativeProbability
public double computeCumulativeProbability(double value)
Computes cumulative probability at a given point of the gamma distribution.- Specified by:
computeCumulativeProbabilityin interfaceDistribution- Parameters:
value- point selected- Returns:
- cumulative probability at 'value'
-
regularizedGammaP
public double regularizedGammaP(double a, double x)Computes regularized gamma P function- Parameters:
a- a parameterx- x value- Returns:
- value of the regularized gamma P function
-
regularizedGammaQ
public double regularizedGammaQ(double a, double x)Computes regularized gamma Q function- Parameters:
a- a parameterx- x value- Returns:
- value of the regularized gamma Q function
-
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