Class ExpGammaDistribution
- java.lang.Object
-
- elki.math.statistics.distribution.ExpGammaDistribution
-
- All Implemented Interfaces:
Distribution
public class ExpGammaDistribution extends java.lang.Object implements Distribution
Exp-Gamma Distribution, with random generation and density functions.This distribution can be outlined as Y ~ log[Gamma] distributed, or equivalently exp(Y) ~ Gamma.
Note: this matches the loggamma of SciPy, whereas Wolfram calls this the Exponential Gamma Distribution "at times confused with the LogGammaDistribution".
- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpGammaDistribution.Par
Parameterization class-
Nested classes/interfaces inherited from interface elki.math.statistics.distribution.Distribution
Distribution.Parameterizer
-
-
Constructor Summary
Constructors Constructor Description ExpGammaDistribution(double k, double theta, double shift)
Constructor for Gamma distribution.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
cdf(double val)
Return the cumulative density function at the given value.static double
cdf(double x, double k, double theta, double shift)
The CDF, static version.double
getK()
double
getTheta()
static double
logcdf(double x, double k, double theta, double shift)
The log CDF, static version.double
logpdf(double val)
Return the log density of an existing valuestatic double
logpdf(double x, double k, double theta, double shift)
ExpGamma distribution logPDFdouble
nextRandom(java.util.Random random)
Generate a new random valuedouble
pdf(double val)
Return the density of an existing valuestatic double
pdf(double x, double k, double theta, double shift)
ExpGamma distribution PDF (with 0.0 for x < 0)double
quantile(double val)
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.static double
quantile(double p, double k, double theta, double shift)
Compute probit (inverse cdf) for ExpGamma distributions.java.lang.String
toString()
Simple toString explaining the distribution parameters.
-
-
-
Method Detail
-
pdf
public double pdf(double val)
Description copied from interface:Distribution
Return the density of an existing value- Specified by:
pdf
in interfaceDistribution
- Parameters:
val
- existing value- Returns:
- distribution density
-
logpdf
public double logpdf(double val)
Description copied from interface:Distribution
Return the log density of an existing value- Specified by:
logpdf
in interfaceDistribution
- Parameters:
val
- existing value- Returns:
- log distribution density
-
cdf
public double cdf(double val)
Description copied from interface:Distribution
Return the cumulative density function at the given value.- Specified by:
cdf
in interfaceDistribution
- Parameters:
val
- existing value- Returns:
- cumulative density
-
quantile
public double quantile(double val)
Description copied from interface:Distribution
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.- Specified by:
quantile
in interfaceDistribution
- Parameters:
val
- Quantile to find- Returns:
- Quantile position
-
nextRandom
public double nextRandom(java.util.Random random)
Description copied from interface:Distribution
Generate a new random value- Specified by:
nextRandom
in interfaceDistribution
- Parameters:
random
- Random number generator- Returns:
- new random value
-
toString
public java.lang.String toString()
Simple toString explaining the distribution parameters. Used in producing a model description.- Specified by:
toString
in interfaceDistribution
- Overrides:
toString
in classjava.lang.Object
- Returns:
- description
-
getK
public double getK()
- Returns:
- the value of k
-
getTheta
public double getTheta()
- Returns:
- the standard deviation
-
cdf
public static double cdf(double x, double k, double theta, double shift)
The CDF, static version.- Parameters:
x
- Valuek
- Shape ktheta
- Theta = 1.0/Beta aka. "scaling" parameter- Returns:
- cdf value
-
logcdf
public static double logcdf(double x, double k, double theta, double shift)
The log CDF, static version.- Parameters:
x
- Valuek
- Shape ktheta
- Theta = 1.0/Beta aka. "scaling" parameter- Returns:
- cdf value
-
pdf
public static double pdf(double x, double k, double theta, double shift)
ExpGamma distribution PDF (with 0.0 for x < 0)- Parameters:
x
- query valuek
- Alphatheta
- Theta = 1 / Beta- Returns:
- probability density
-
logpdf
public static double logpdf(double x, double k, double theta, double shift)
ExpGamma distribution logPDF- Parameters:
x
- query valuek
- Alphatheta
- Theta = 1 / Beta- Returns:
- log probability density
-
quantile
public static double quantile(double p, double k, double theta, double shift)
Compute probit (inverse cdf) for ExpGamma distributions.- Parameters:
p
- Probabilityk
- k, alpha aka. "shape" parametertheta
- Theta = 1.0/Beta aka. "scaling" parametershift
- Shift parameter- Returns:
- Probit for ExpGamma distribution
-
-