bpp-core3
3.0.0
|
Density estimation using the adaptive kernel method. More...
#include <Bpp/Numeric/AdaptiveKernelDensityEstimation.h>
Public Member Functions | |
AdaptiveKernelDensityEstimation (const Matrix< double > &x, double gamma=0.5) | |
Build a new AdaptiveKernelDensityEstimation object. More... | |
virtual | ~AdaptiveKernelDensityEstimation () |
double | kDensity (const std::vector< double > &x) |
Private Member Functions | |
void | init_ () |
void | sampleMean_ (const Matrix< double > &x, std::vector< double > &mean) |
double | kernel_ (const Matrix< double > &x) |
The kernel function. More... | |
Private Attributes | |
RowMatrix< double > | x_ |
size_t | n_ |
size_t | r_ |
RowMatrix< double > | covar_ |
RowMatrix< double > | invSqrtCovar_ |
std::vector< double > | xMean_ |
double | gamma_ |
double | c1_ |
std::vector< double > | c2_ |
double | h_ |
std::vector< double > | lambda_ |
std::vector< double > | pilot_ |
Density estimation using the adaptive kernel method.
For now this implementation is quite restricted, more options may be implemented later...
The source for this method can be found is the appendix of the following paper: Ivan Kojadinovic, Computational Statistics and Data Analaysis (2004), 46:269-294
Definition at line 23 of file AdaptiveKernelDensityEstimation.h.
|
inline |
Build a new AdaptiveKernelDensityEstimation object.
x | A mtrix contianing the sample point, one point per column. The row of the matrix are the dimension of the sampled vectors, wich can be 1. |
gamma | Controls the influence of the pilot density. A value of 0 maximizes the impact of the pilot density, and hence corresponds to the standard Kernel Density Estimation method. A value in ]0,1] allows a local adjustement of the bandwith. The 0.5 value is commonly used. |
Definition at line 49 of file AdaptiveKernelDensityEstimation.h.
References init_().
|
inlinevirtual |
Definition at line 57 of file AdaptiveKernelDensityEstimation.h.
References init_(), kDensity(), kernel_(), and sampleMean_().
|
private |
Definition at line 12 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::MatrixTools::covar(), bpp::MatrixTools::det(), bpp::MatrixTools::mult(), and bpp::MatrixTools::scale().
Referenced by AdaptiveKernelDensityEstimation(), and ~AdaptiveKernelDensityEstimation().
double AdaptiveKernelDensityEstimation::kDensity | ( | const std::vector< double > & | x | ) |
x | The point where to estimate the density. |
Definition at line 104 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::MatrixTools::mult(), and bpp::MatrixTools::scale().
Referenced by bpp::VectorTools::miContinuous(), bpp::VectorTools::shannonContinuous(), and ~AdaptiveKernelDensityEstimation().
|
private |
The kernel function.
For now a standard normal density is used, further options may be added later, including the possibility to use your own function.
x | The point for which to compute the density, as a matrix with 1 column and r_ rows. |
Definition at line 91 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::NumConstants::PI().
Referenced by ~AdaptiveKernelDensityEstimation().
|
private |
Definition at line 75 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
Referenced by ~AdaptiveKernelDensityEstimation().
|
private |
Definition at line 33 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 34 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 29 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 32 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 35 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 30 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 36 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 27 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 37 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 28 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 26 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 31 of file AdaptiveKernelDensityEstimation.h.