Page MenuHomeHEPForge

BandwidthCVPseudoLogli1D.hh
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

BandwidthCVPseudoLogli1D.hh

#ifndef NPSTAT_BANDWIDTHCVPSEUDOLOGLI1D_HH_
#define NPSTAT_BANDWIDTHCVPSEUDOLOGLI1D_HH_
/*!
// \file BandwidthCVPseudoLogli1D.hh
//
// \brief Cross-validating one-dimensional density estimates by optimizing
// regularized pseudo log-likelihood
//
// Author: I. Volobouev
//
// September 2010
*/
#include "npstat/stat/AbsBandwidthCV.hh"
namespace npstat {
/**
// Class for calculating KDE or LOrPE cross-validation pseudo
// log-likelihood, for 1-dimensional density estimates. This class
// is intended for use inside degree and/or bandwidth scans.
*/
template<
typename Numeric,
typename Num2,
typename Num3 = double,
typename Num4 = double
>
class BandwidthCVPseudoLogli1D :
public AbsBandwidthCV1D<Numeric,Num2,Num3,Num4>
{
public:
/**
// Parameter "regularizationPower" is used to limit the contributions
// into the overall pseudo log likelihood from points for which the
// "leaving one out" density is very low. For those points, instead
// of "leaving one out" density, we will use the density generated by
// that point itself divided by pow(N, regularizationPower). This
// method limits the effect of tails on bandwidth determination.
*/
inline explicit BandwidthCVPseudoLogli1D(double regularizationPower=0.5)
: renormPow_(regularizationPower), nonZeroCount_(0), renormCount_(0) {}
inline virtual ~BandwidthCVPseudoLogli1D() {}
inline unsigned long getNonZeroCount() const {return nonZeroCount_;}
inline unsigned long getRenormCount() const {return renormCount_;}
// Unweighted samples
virtual double operator()(
const HistoND<Numeric>& histo,
const Num2* densityEstimate,
unsigned lenEstimate,
const AbsPolyFilter1D& filterUsed) const;
// Weighted samples
virtual double operator()(
const HistoND<Numeric>& histo,
double effectiveSampleSize,
const Num2* densityEstimate,
unsigned lenEstimate,
const AbsPolyFilter1D& filterUsed) const;
// Weighted samples in case the sample is available
virtual double operator()(
const HistoND<Numeric>& histo,
const std::pair<Num3, Num4>* sample,
unsigned long lenSample,
const Num2* densityEstimate,
unsigned lenEstimate,
const AbsPolyFilter1D& filterUsed) const;
private:
double renormPow_;
mutable unsigned long nonZeroCount_;
mutable unsigned long renormCount_;
};
}
#include "npstat/stat/BandwidthCVPseudoLogli1D.icc"
#endif // NPSTAT_BANDWIDTHCVPSEUDOLOGLI1D_HH_

File Metadata

Mime Type
text/x-c
Expires
Tue, Sep 30, 4:44 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6564799
Default Alt Text
BandwidthCVPseudoLogli1D.hh (2 KB)

Event Timeline