bpp-core
2.2.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 58 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 84 of file AdaptiveKernelDensityEstimation.h.
References init_().
|
inlinevirtual |
Definition at line 92 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 47 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::MatrixTools::covar(), bpp::MatrixTools::det(), bpp::MatrixTools::mult(), and bpp::MatrixTools::scale().
Referenced by AdaptiveKernelDensityEstimation().
double AdaptiveKernelDensityEstimation::kDensity | ( | const std::vector< double > & | x | ) |
x | The point where to estimate the density. |
Definition at line 125 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::MatrixTools::mult(), and bpp::MatrixTools::scale().
Referenced by bpp::VectorTools::miContinuous(), and bpp::VectorTools::shannonContinuous().
|
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 114 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::NumConstants::PI().
|
private |
Definition at line 100 of file AdaptiveKernelDensityEstimation.cpp.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
|
private |
Definition at line 68 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 69 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 64 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 67 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 70 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 65 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 71 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 62 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 72 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 63 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 61 of file AdaptiveKernelDensityEstimation.h.
|
private |
Definition at line 66 of file AdaptiveKernelDensityEstimation.h.