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, wait
rand
public 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()
Distribution
length
in interface Distribution
public double mean()
Distribution
mean
in interface Distribution
public double variance()
Distribution
variance
in interface Distribution
public double sd()
Distribution
sd
in interface Distribution
public double entropy()
entropy
in interface Distribution
public double rand()
rand
in interface Distribution
public double p(double x)
Distribution
p
in interface Distribution
public double logp(double x)
Distribution
logp
in interface Distribution
public double cdf(double x)
cdf
in interface Distribution
public double quantile(double p)
quantile
in interface Distribution
public double likelihood(double[] x)
likelihood
in interface Distribution
public double logLikelihood(double[] x)
logLikelihood
in interface Distribution