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 classLogGammaDistribution.ParParameterization 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 doublecdf(double val)Return the cumulative density function at the given value.static doublecdf(double x, double k, double theta, double shift)The CDF, static version.doublegetK()doublegetTheta()static doublelogcdf(double x, double k, double theta, double shift)The log CDF, static version.doublelogpdf(double val)Return the log density of an existing valuestatic doublelogpdf(double x, double k, double theta, double shift)LogGamma distribution logPDFdoublenextRandom(java.util.Random random)Generate a new random valuedoublepdf(double val)Return the density of an existing valuestatic doublepdf(double x, double k, double theta, double shift)LogGamma distribution PDF (with 0.0 for x < 0)doublequantile(double val)Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.static doublequantile(double p, double k, double theta, double shift)Compute probit (inverse cdf) for LogGamma distributions.java.lang.StringtoString()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:DistributionReturn the density of an existing value- Specified by:
pdfin interfaceDistribution- Parameters:
val- existing value- Returns:
- distribution density
-
logpdf
public double logpdf(double val)
Description copied from interface:DistributionReturn the log density of an existing value- Specified by:
logpdfin interfaceDistribution- Parameters:
val- existing value- Returns:
- log distribution density
-
cdf
public double cdf(double val)
Description copied from interface:DistributionReturn the cumulative density function at the given value.- Specified by:
cdfin interfaceDistribution- Parameters:
val- existing value- Returns:
- cumulative density
-
quantile
public double quantile(double val)
Description copied from interface:DistributionQuantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.- Specified by:
quantilein interfaceDistribution- Parameters:
val- Quantile to find- Returns:
- Quantile position
-
nextRandom
public double nextRandom(java.util.Random random)
Description copied from interface:DistributionGenerate a new random value- Specified by:
nextRandomin 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:
toStringin interfaceDistribution- Overrides:
toStringin 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
-
-