Class LogGammaDistribution
- java.lang.Object
-
- elki.math.statistics.distribution.LogGammaDistribution
-
- All Implemented Interfaces:
Distribution
public class LogGammaDistribution extends java.lang.Object implements Distribution
Log-Gamma Distribution, with random generation and density functions.This distribution can be outlined as Y ~ exp(Gamma) or equivalently Log(Y) ~ Gamma.
Note: this is a different loggamma than scipy uses, but corresponds to the Log Gamma Distribution of Wolfram, who notes that it is "at times confused with ExpGammaDistribution".
- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LogGammaDistribution.Par
Parameterization class-
Nested classes/interfaces inherited from interface elki.math.statistics.distribution.Distribution
Distribution.Parameterizer
-
-
Constructor Summary
Constructors Constructor Description LogGammaDistribution(double k, double theta)
Constructor for Gamma distribution.LogGammaDistribution(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)
LogGamma 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)
LogGamma 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 LogGamma distributions.java.lang.String
toString()
Simple toString explaining the distribution parameters.
-
-
-
Constructor Detail
-
LogGammaDistribution
public LogGammaDistribution(double k, double theta)
Constructor for Gamma distribution.- Parameters:
k
- k, alpha aka. "shape" parametertheta
- Theta = 1.0/Beta aka. "scaling" parameter
-
LogGammaDistribution
public LogGammaDistribution(double k, double theta, double shift)
Constructor for Gamma distribution.- Parameters:
k
- k, alpha aka. "shape" parametertheta
- Theta = 1.0/Beta aka. "scaling" parametershift
- Location offset
-
-
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)
LogGamma 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)
LogGamma 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 LogGamma distributions.- Parameters:
p
- Probabilityk
- k, alpha aka. "shape" parametertheta
- Theta = 1.0/Beta aka. "scaling" parametershift
- Shift parameter- Returns:
- Probit for Gamma distribution
-
-