public class LogGammaDistribution extends Object implements DistributionWithRandom
Modifier and Type | Class and Description |
---|---|
static class |
LogGammaDistribution.ChoiWetteEstimator
Estimate distribution parameters using the method by Choi and Wette.
|
static class |
LogGammaDistribution.MADEstimator
Robust parameter estimation for the LogGamma distribution.
|
static class |
LogGammaDistribution.NaiveEstimator
Simple parameter estimation for the Gamma distribution.
|
Modifier and Type | Field and Description |
---|---|
static LogGammaDistribution.ChoiWetteEstimator |
CHOI_WETTE_ESTIMATOR
Static estimation, using iterative refinement.
|
private double |
k
Alpha == k.
|
static LogGammaDistribution.MADEstimator |
MAD_ESTIMATOR
Static estimator, more robust to outliers by using the median.
|
static LogGammaDistribution.NaiveEstimator |
NAIVE_ESTIMATOR
Static estimation using just the mean and variance.
|
private Random |
random
The random generator.
|
private double |
shift
Translation offset.
|
private double |
theta
Theta == 1 / Beta.
|
Constructor and Description |
---|
LogGammaDistribution(double k,
double theta,
double shift)
Constructor for Gamma distribution.
|
LogGammaDistribution(double k,
double theta,
double shift,
Random random)
Constructor for Gamma distribution.
|
Modifier and Type | Method and Description |
---|---|
double |
cdf(double val)
Return the cumulative density function at the given value.
|
static double |
cdf(double val,
double k,
double theta,
double shift)
The CDF, static version.
|
double |
getK() |
double |
getTheta() |
static double |
logcdf(double val,
double k,
double theta,
double shift)
The log CDF, static version.
|
static double |
logpdf(double x,
double k,
double theta,
double shift)
LogGamma distribution PDF (with 0.0 for x < 0)
|
double |
nextRandom()
Generate a new random value
|
double |
pdf(double val)
Return the density of an existing value
|
static 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.
|
String |
toString()
Simple toString explaining the distribution parameters.
|
public static final LogGammaDistribution.ChoiWetteEstimator CHOI_WETTE_ESTIMATOR
public static final LogGammaDistribution.NaiveEstimator NAIVE_ESTIMATOR
public static final LogGammaDistribution.MADEstimator MAD_ESTIMATOR
private final double k
private final double theta
private final double shift
private Random random
public LogGammaDistribution(double k, double theta, double shift, Random random)
k
- k, alpha aka. "shape" parametershift
- Location offsettheta
- Theta = 1.0/Beta aka. "scaling" parameterrandom
- Random generatorpublic LogGammaDistribution(double k, double theta, double shift)
k
- k, alpha aka. "shape" parametertheta
- Theta = 1.0/Beta aka. "scaling" parametershift
- Location offsetpublic double pdf(double val)
Distribution
pdf
in interface Distribution
val
- existing valuepublic double cdf(double val)
Distribution
cdf
in interface Distribution
val
- existing valuepublic double quantile(double val)
Distribution
quantile
in interface Distribution
val
- Quantile to findpublic double nextRandom()
DistributionWithRandom
nextRandom
in interface DistributionWithRandom
public String toString()
toString
in interface Distribution
toString
in class Object
public double getK()
public double getTheta()
public static double cdf(double val, double k, double theta, double shift)
val
- Valuek
- Shape ktheta
- Theta = 1.0/Beta aka. "scaling" parameterpublic static double logcdf(double val, double k, double theta, double shift)
val
- Valuek
- Shape ktheta
- Theta = 1.0/Beta aka. "scaling" parameterpublic static double pdf(double x, double k, double theta, double shift)
x
- query valuek
- Alphatheta
- Theta = 1 / Betapublic static double logpdf(double x, double k, double theta, double shift)
x
- query valuek
- Alphatheta
- Theta = 1 / Betapublic static double quantile(double p, double k, double theta, double shift)
p
- Probabilityk
- k, alpha aka. "shape" parametertheta
- Theta = 1.0/Beta aka. "scaling" parameter