An estimator for a Kernel Density Estimate that estimates the kde on a box as the kde evaluated at the mid-point of the box. More...
Public Member Functions | |
RealKDEMidEstimator (const subpavings::kde::TypeKDE &f) | |
Constructor. | |
cxsc::real | visit (SPnode *spn) const |
The visit operation. | |
cxsc::real | operator() (const std::vector< cxsc::real > &x) const |
Evaluate the kernel density estimate at single point. | |
cxsc::real | operator() (const cxsc::rvector &x) const |
Evaluate the kernel density estimate at single point. | |
cxsc::real | operator() (const cxsc::ivector &x) const |
Estimate of the function value over a box x. |
An estimator for a Kernel Density Estimate that estimates the kde on a box as the kde evaluated at the mid-point of the box.
Constructor.
f | describes a kde to be estimated. |
: fobj(f) {}
cxsc::real subpavings::RealKDEMidEstimator::operator() | ( | const std::vector< cxsc::real > & | x | ) | const [virtual] |
Evaluate the kernel density estimate at single point.
x | the point at which to evaluate the kernel density, given as a vector of reals rather than an rvector. |
Implements subpavings::RealPointwiseFunctionEstimator.
{ return fobj.kde(x); }
cxsc::real subpavings::RealKDEMidEstimator::operator() | ( | const cxsc::rvector & | x | ) | const [virtual] |
Evaluate the kernel density estimate at single point.
x | the point at which to evaluate the kernel density. |
Implements subpavings::RealPointwiseFunctionEstimator.
{ return fobj.kde(x); }
cxsc::real subpavings::RealKDEMidEstimator::operator() | ( | const cxsc::ivector & | x | ) | const [virtual] |
Estimate of the function value over a box x.
x | the box over which to estimate the kernel density. |
Implements subpavings::RealPointwiseFunctionEstimator.
{ int lb = Lb(x); int dim = lb + Ub(x) + 1; std::vector < cxsc::real > rv(dim); for (int i = 0; i < dim; ++i) rv[i] = mid(x[lb+i]); return fobj.kde(rv); }
cxsc::real subpavings::RealKDEMidEstimator::visit | ( | SPnode * | spn | ) | const [virtual] |
The visit operation.
spn | a pointer to an SPnode to be visited. |
Implements subpavings::SPValueVisitor< cxsc::real >.
{ #ifdef MYDEBUG std::cout << "in RealKDEMidEstimator::visit, for " << spn->getNodeName() << std::endl; #endif ivector box = spn->getBox(); #ifdef MYDEBUG std::cout << "this box is " << box << std::endl; #endif real thisRange = this->operator()(box); #ifdef MYDEBUG std::cout << "this range at midpoint is " << thisRange << std::endl; #endif return thisRange; }