public class ProductKDE extends MultivariateKDE
KernelDensityEstimator
to the multivariate case.
This is done by using a kernel and bandwidth for each dimension, such that the bandwidth for each dimension can be
determined using the same methods as the univariate KDE. This can simplify the difficulty in bandwidth selection
for the multivariate case.MetricKDE
,
Serialized FormConstructor and Description |
---|
ProductKDE()
Creates a new KDE that uses the
EpanechnikovKF kernel. |
ProductKDE(KernelFunction k)
Creates a new KDE that uses the specified kernel
|
Modifier and Type | Method and Description |
---|---|
ProductKDE |
clone() |
KernelFunction |
getKernelFunction() |
List<VecPaired<VecPaired<Vec,Integer>,Double>> |
getNearby(Vec x)
Returns the list of vectors that have a non zero contribution to the density of the query point x.
|
List<VecPaired<VecPaired<Vec,Integer>,Double>> |
getNearbyRaw(Vec x)
Returns the list of vectors that have a non zero contribution to the density of the query point x.
|
double |
pdf(Vec x)
Returns the probability of a given vector from this distribution.
|
List<Vec> |
sample(int count,
Random rand)
Performs sampling on the current distribution.
|
void |
scaleBandwidth(double scale)
A caller may want to increase or decrease the bandwidth after training
has been completed to get smoother model, or decrease it to observe
behavior.
|
<V extends Vec> |
setUsingData(List<V> dataSet)
Sets the parameters of the distribution to attempt to fit the given list of vectors.
|
boolean |
setUsingDataList(List<DataPoint> dataPoints)
Sets the parameters of the distribution to attempt to fit the given list of data points.
|
logPdf, logPdf, pdf, setUsingData, setUsingData, setUsingData, setUsingDataList
public ProductKDE()
EpanechnikovKF
kernel.public ProductKDE(KernelFunction k)
k
- the kernel method to usepublic ProductKDE clone()
clone
in interface MultivariateDistribution
clone
in class MultivariateKDE
public List<VecPaired<VecPaired<Vec,Integer>,Double>> getNearby(Vec x)
MultivariateKDE
getNearby
in class MultivariateKDE
x
- the query pointpublic List<VecPaired<VecPaired<Vec,Integer>,Double>> getNearbyRaw(Vec x)
MultivariateKDE
getNearbyRaw
in class MultivariateKDE
x
- the query pointpublic double pdf(Vec x)
MultivariateDistribution
x
- the vector the get the log probability ofpublic <V extends Vec> boolean setUsingData(List<V> dataSet)
MultivariateDistribution
V
- the vector typedataSet
- the list of data pointspublic boolean setUsingDataList(List<DataPoint> dataPoints)
MultivariateDistribution
weights
of the data points will be used.dataPoints
- the list of data points to usepublic List<Vec> sample(int count, Random rand)
MultivariateDistribution
count
- the number of iid samples to drawrand
- the source of randomnesspublic KernelFunction getKernelFunction()
getKernelFunction
in class MultivariateKDE
public void scaleBandwidth(double scale)
MultivariateKDE
scaleBandwidth
in class MultivariateKDE
scale
- the value to scale the bandwidth usedCopyright © 2017. All rights reserved.