npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::ConstantBandwidthSmootherND< MaxDeg > Class Template Reference

#include <ConstantBandwidthSmootherND.hh>

Public Types

enum  { deg_size = MaxDeg }
 

Public Member Functions

template<class Numeric >
 ConstantBandwidthSmootherND (const HistoND< Numeric > &protoHisto, const AbsDistributionND &kernel, const double *taper, unsigned maxDeg, bool mirror=true)
 
unsigned dim () const
 
const ArrayShapeshape () const
 
const unsigned * shapeData () const
 
unsigned maxDegree () const
 
bool mirrorsData () const
 
double taper (unsigned degree) const
 
template<class Numeric , class Real >
void smoothHistogram (const HistoND< Numeric > &histoIn, HistoND< Real > *histoOut)
 

Static Public Member Functions

static unsigned classMaxDegree ()
 

Detailed Description

template<unsigned MaxDeg>
class npstat::ConstantBandwidthSmootherND< MaxDeg >

N-d KDE implementation with constant bandwidth. Uses FFT, so it should be reasonably fast even if the number of bins is large. By default, the data is mirrored at the boundaries to reduce the edge effects.

The output density is truncated non-negative and normalized.

If you would like to run cross-validation on bandwidth scans, consider using a collection of KDEFilterND objects instead.

Constructor & Destructor Documentation

◆ ConstantBandwidthSmootherND()

template<unsigned MaxDeg>
template<class Numeric >
npstat::ConstantBandwidthSmootherND< MaxDeg >::ConstantBandwidthSmootherND ( const HistoND< Numeric > &  protoHisto,
const AbsDistributionND kernel,
const double *  taper,
unsigned  maxDeg,
bool  mirror = true 
)

Constructor arguments are as follows:

protoHisto – Prototype histogram which defines expected data shape and grid coordinates.

kernel – The "base" kernel function. This must have correct bandwidth settings already. Normally, the location vector has to be set to all zeros.

taper – Damping factors for each polynomial degree (starting with the 0th order term). This can be NULL in which case it is assumed that all factors are 1.

maxDeg – Polynomial degree to use with the given kernel. Must not exceed the MaxDeg template parameter.

mirror – If true, the data will be mirrored at the boundaries to reduce the edge effects.

Member Function Documentation

◆ dim()

template<unsigned MaxDeg>
unsigned npstat::ConstantBandwidthSmootherND< MaxDeg >::dim ( ) const
inline

Simple inspector of object properties

◆ smoothHistogram()

template<unsigned MaxDeg>
template<class Numeric , class Real >
void npstat::ConstantBandwidthSmootherND< MaxDeg >::smoothHistogram ( const HistoND< Numeric > &  histoIn,
HistoND< Real > *  histoOut 
)

Perform actual convolution. histoIn and histoOut can refer to the same histogram.


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