public class KernelDensity extends java.lang.Object implements Distribution
| Constructor and Description |
|---|
KernelDensity(double[] x)
Constructor.
|
KernelDensity(double[] x,
double h)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
bandwidth()
Returns the bandwidth of kernel.
|
double |
cdf(double x)
Cumulative distribution function.
|
double |
entropy()
Shannon entropy.
|
int |
length()
The number of parameters of the distribution.
|
double |
likelihood(double[] x)
The likelihood of the samples.
|
double |
logLikelihood(double[] x)
The log likelihood of the samples.
|
double |
logp(double x)
The density at x in log scale, which may prevents the underflow problem.
|
double |
mean()
The mean of distribution.
|
double |
p(double x)
The probability density function for continuous distribution
or probability mass function for discrete distribution at x.
|
double |
quantile(double p)
Inverse of CDF.
|
double |
rand()
Random number generator.
|
double |
sd()
The standard deviation of distribution.
|
double |
variance()
The variance of distribution.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrandpublic KernelDensity(double[] x)
x - the samples to estimate the density function.public KernelDensity(double[] x,
double h)
x - the samples to estimate the density function.h - a bandwidth parameter for smoothing.public double bandwidth()
public int length()
Distributionlength in interface Distributionpublic double mean()
Distributionmean in interface Distributionpublic double variance()
Distributionvariance in interface Distributionpublic double sd()
Distributionsd in interface Distributionpublic double entropy()
entropy in interface Distributionpublic double rand()
rand in interface Distributionpublic double p(double x)
Distributionp in interface Distributionpublic double logp(double x)
Distributionlogp in interface Distributionpublic double cdf(double x)
cdf in interface Distributionpublic double quantile(double p)
quantile in interface Distributionpublic double likelihood(double[] x)
likelihood in interface Distributionpublic double logLikelihood(double[] x)
logLikelihood in interface Distribution