MRS  1.0
A C++ Class Library for Statistical Set Processing
subpavings::RealKDEMidEstimator Class Reference

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...

+ Inheritance diagram for subpavings::RealKDEMidEstimator:
+ Collaboration diagram for subpavings::RealKDEMidEstimator:

List of all members.

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.

Detailed Description

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 & Destructor Documentation

Constructor.

Parameters:
fdescribes a kde to be estimated.
                : fobj(f)
  {}

Member Function Documentation

cxsc::real subpavings::RealKDEMidEstimator::operator() ( const std::vector< cxsc::real > &  x) const [virtual]

Evaluate the kernel density estimate at single point.

Parameters:
xthe point at which to evaluate the kernel density, given as a vector of reals rather than an rvector.
Returns:
the real kernel density estimate evaluated at the rvector corresponding to x.

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.

Parameters:
xthe point at which to evaluate the kernel density.
Returns:
the real kernel density estimate evaluated at x.

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.

Parameters:
xthe box over which to estimate the kernel density.
Returns:
the real kernel density estimate evaluated at the mid-point of x.

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.

Parameters:
spna pointer to an SPnode to be visited.
Returns:
the real kernel density estimate evaluated at the midpoint of the box associated with the node pointed to by spn.

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;
    }

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends