public class ExponentialDistribution extends AbstractDistribution
Modifier and Type | Class and Description |
---|---|
static class |
ExponentialDistribution.Parameterizer
Parameterization class
|
Modifier and Type | Field and Description |
---|---|
(package private) double |
location
Location parameter.
|
(package private) double |
rate
Rate, inverse of mean
|
random
Constructor and Description |
---|
ExponentialDistribution(double rate)
Constructor.
|
ExponentialDistribution(double rate,
double location)
Constructor.
|
ExponentialDistribution(double rate,
double location,
Random random)
Constructor.
|
ExponentialDistribution(double rate,
double location,
RandomFactory random)
Constructor.
|
ExponentialDistribution(double rate,
Random random)
Constructor.
|
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 rate)
Cumulative density, static version
|
double |
nextRandom()
This method currently uses the naive approach of returning
-log(uniform) . |
double |
pdf(double val)
Return the density of an existing value
|
static double |
pdf(double val,
double rate)
PDF, static version
|
double |
quantile(double val)
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
|
static double |
quantile(double val,
double rate)
Quantile function, static version
|
String |
toString()
Describe the distribution
|
public ExponentialDistribution(double rate)
rate
- Rate parameter (1/scale)public ExponentialDistribution(double rate, double location)
rate
- Rate parameter (1/scale)location
- Location parameterpublic ExponentialDistribution(double rate, Random random)
rate
- Rate parameter (1/scale)random
- Random generatorpublic ExponentialDistribution(double rate, double location, Random random)
rate
- Rate parameter (1/scale)location
- Location parameterrandom
- Random generatorpublic ExponentialDistribution(double rate, double location, RandomFactory random)
rate
- Rate parameter (1/scale)location
- Location parameterrandom
- Random generatorpublic double pdf(double val)
Distribution
val
- existing valuepublic static double pdf(double val, double rate)
val
- Value to compute PDF atrate
- Rate parameter (1/scale)public double cdf(double val)
Distribution
val
- existing valuepublic static double cdf(double val, double rate)
val
- Value to compute CDF atrate
- Rate parameter (1/scale)public double quantile(double val)
Distribution
val
- Quantile to findpublic static double quantile(double val, double rate)
val
- Value to compute quantile forrate
- Rate parameterpublic double nextRandom()
-log(uniform)
.
TODO: there are variants that do not rely on the log method and are faster.
We need to implement and evaluate these. For details: see
"Computer methods for sampling from the exponential and normal distributions"
J. H. Ahrens, U. Dieter, https://dl.acm.org/citation.cfm?id=361593nextRandom
in interface Distribution
nextRandom
in class AbstractDistribution
public String toString()
Distribution
toString
in interface Distribution
toString
in class Object
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.