npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::AbsKDE1DKernel Class Referenceabstract

#include <AbsKDE1DKernel.hh>

Inheritance diagram for npstat::AbsKDE1DKernel:
npstat::KDE1DDensityKernel npstat::KDE1DHOSymbetaKernel

Classes

class  MomentFcn
 
class  SquareFcn
 

Public Member Functions

virtual void setNormFactor (double normfactor)=0
 
virtual double xmin () const =0
 
virtual double xmax () const =0
 
virtual double normFactor () const =0
 
virtual double operator() (double x) const =0
 
virtual AbsKDE1DKernelclone () const =0
 
virtual double momentIntegral (unsigned k, unsigned nIntegPoints) const
 
virtual double squaredIntegral (unsigned nIntegPoints) const
 
template<typename Numeric >
double kde (double x, double bandwidth, const Numeric *coords, unsigned long nCoords, bool coordinatesSorted=false) const
 
template<typename Numeric >
double reverseKde (double x, double bandwidth, const Numeric *coords, unsigned long nCoords, bool coordinatesSorted=false) const
 
double looKde (double bandwidth, unsigned long nCoords, double originalDensityEstimate) const
 
template<typename Numeric >
double integratedSquaredError (const AbsDistribution1D &distro, unsigned nIntegIntervals, unsigned nIntegPoints, double bandwidth, bool useReverseKde, const Numeric *coords, unsigned long nCoords, bool coordinatesSorted=false) const
 
template<typename Numeric >
double integratedKdeSquared (double xmin, double xmax, unsigned nIntegIntervals, unsigned nIntegPoints, double bandwidth, bool useReverseKde, const Numeric *coords, unsigned long nCoords, bool coordinatesSorted=false) const
 

Detailed Description

Base class for 1-d kernels and KDE

Member Function Documentation

◆ clone()

virtual AbsKDE1DKernel* npstat::AbsKDE1DKernel::clone ( ) const
pure virtual

"Virtual copy constructor"

Implemented in npstat::KDE1DHOSymbetaKernel, and npstat::KDE1DDensityKernel.

◆ integratedKdeSquared()

template<typename Numeric >
double npstat::AbsKDE1DKernel::integratedKdeSquared ( double  xmin,
double  xmax,
unsigned  nIntegIntervals,
unsigned  nIntegPoints,
double  bandwidth,
bool  useReverseKde,
const Numeric *  coords,
unsigned long  nCoords,
bool  coordinatesSorted = false 
) const

Integral of KDE squared. Parameter "nIntegPoints" is the number of integration points per interval, and it must be supported by the GaussLegendreQuadrature class.

◆ integratedSquaredError()

template<typename Numeric >
double npstat::AbsKDE1DKernel::integratedSquaredError ( const AbsDistribution1D distro,
unsigned  nIntegIntervals,
unsigned  nIntegPoints,
double  bandwidth,
bool  useReverseKde,
const Numeric *  coords,
unsigned long  nCoords,
bool  coordinatesSorted = false 
) const

Integrated squared error w.r.t. a known density. Parameter "nIntegPoints" is the number of integration points per interval, and it must be supported by the GaussLegendreQuadrature class. The integration interval is defined by the support of the density.

◆ kde()

template<typename Numeric >
double npstat::AbsKDE1DKernel::kde ( double  x,
double  bandwidth,
const Numeric *  coords,
unsigned long  nCoords,
bool  coordinatesSorted = false 
) const

Summing K((x - x[i])/h), as in the standard KDE definition. Setting "coordinatesSorted" flag to "true" if coordinates are sorted in the increasing order can potentially increase the speed of KDE evaluation.

◆ looKde()

double npstat::AbsKDE1DKernel::looKde ( double  bandwidth,
unsigned long  nCoords,
double  originalDensityEstimate 
) const

Leave-one-out density estimate. The original density estimate should be obtained earlier with either "kde" or "reverseKde" method used with the same values of "bandwidth" and "nCoords" arguments.

◆ momentIntegral()

virtual double npstat::AbsKDE1DKernel::momentIntegral ( unsigned  k,
unsigned  nIntegPoints 
) const
virtual

"nIntegPoints" argument in the following method is the number of points to use in the quadrature rule. If this method is not overriden, Gauss-Legendre quadrature is used.

◆ reverseKde()

template<typename Numeric >
double npstat::AbsKDE1DKernel::reverseKde ( double  x,
double  bandwidth,
const Numeric *  coords,
unsigned long  nCoords,
bool  coordinatesSorted = false 
) const

Summing K((x[i] - x)/h)


The documentation for this class was generated from the following file: