npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0

#include <GaussianMixture1D.hh>

Inheritance diagram for npstat::GaussianMixture1D:
npstat::AbsScalableDistribution1D npstat::AbsDistribution1D

Public Member Functions

 GaussianMixture1D (double location, double scale, const GaussianMixtureEntry *entries, unsigned nEntries)
 
 GaussianMixture1D (double location, double scale, const std::vector< GaussianMixtureEntry > &entries)
 
 GaussianMixture1D (const Gauss1D &gauss)
 
virtual GaussianMixture1Dclone () const
 
unsigned nentries () const
 
const GaussianMixtureEntryentry (const unsigned n) const
 
const std::vector< GaussianMixtureEntry > & entries () const
 
virtual unsigned random (AbsRandomGenerator &g, double *r) const
 
double mean () const
 
double stdev () const
 
double gaussianMISE (unsigned maxPolyDegree, double bandwidth, unsigned long npoints) const
 
double miseOptimalBw (unsigned maxPolyDegree, unsigned long npoints, double *mise=0) const
 
virtual gs::ClassId classId () const
 
virtual bool write (std::ostream &os) const
 
- Public Member Functions inherited from npstat::AbsScalableDistribution1D
 AbsScalableDistribution1D (const double location, const double scale)
 
double location () const
 
double scale () const
 
void setLocation (const double v)
 
void setScale (const double v)
 
double density (const double x) const
 
double cdf (const double x) const
 
double exceedance (const double x) const
 
double quantile (const double x) const
 
- Public Member Functions inherited from npstat::AbsDistribution1D
bool operator== (const AbsDistribution1D &r) const
 
bool operator!= (const AbsDistribution1D &r) const
 
long double empiricalMoment (long double center, unsigned order, unsigned nIntegrationPoints=1024U, bool useFejerQuadrature=false) const
 
template<class Functor >
double expectation (const Functor &fcn, unsigned nIntegrationPoints=1024U, bool useFejerQuadrature=false) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static GaussianMixture1Dread (const gs::ClassId &id, std::istream &in)
 
- Static Public Member Functions inherited from npstat::AbsScalableDistribution1D
static bool read (std::istream &is, double *location, double *scale)
 
- Static Public Member Functions inherited from npstat::AbsDistribution1D
static const char * classname ()
 
static unsigned version ()
 
static AbsDistribution1Dread (const gs::ClassId &id, std::istream &)
 

Protected Member Functions

virtual bool isEqual (const AbsDistribution1D &r) const
 

Friends

class ScalableDistribution1DFactory< GaussianMixture1D >
 
class GaussianMISEFunctor
 

Detailed Description

One-dimensional Gaussian mixture distribution

Constructor & Destructor Documentation

◆ GaussianMixture1D() [1/2]

npstat::GaussianMixture1D::GaussianMixture1D ( double  location,
double  scale,
const GaussianMixtureEntry entries,
unsigned  nEntries 
)

This constructor takes an array of GaussianMixtureEntry objects together with an overall location and scale parameters which are used to shift and scale the whole distribution. There must be at least one component with positive weight in the array of entries. The sum of weights will be normalized to 1 internally.

◆ GaussianMixture1D() [2/2]

npstat::GaussianMixture1D::GaussianMixture1D ( const Gauss1D gauss)
explicit

Constructor from a single Gaussian distribution

Member Function Documentation

◆ classId()

virtual gs::ClassId npstat::GaussianMixture1D::classId ( ) const
inlinevirtual

Methods needed for "geners" I/O

Implements npstat::AbsScalableDistribution1D.

◆ clone()

virtual GaussianMixture1D* npstat::GaussianMixture1D::clone ( ) const
inlinevirtual

"Virtual copy constructor"

Implements npstat::AbsScalableDistribution1D.

◆ entries()

const std::vector<GaussianMixtureEntry>& npstat::GaussianMixture1D::entries ( ) const
inline

Get all mixture components

◆ entry()

const GaussianMixtureEntry& npstat::GaussianMixture1D::entry ( const unsigned  n) const
inline

Get the mixture component with the given number

◆ gaussianMISE()

double npstat::GaussianMixture1D::gaussianMISE ( unsigned  maxPolyDegree,
double  bandwidth,
unsigned long  npoints 
) const

Mean Integrated Squared Error expected for KDE of a sample from this mixture using Hermite polynomial kernel. The formula is from the article "Exact Mean Integrated Squared Error" by J.S. Marron and M.P. Wand, The Annals Of Statistics, Vol 20, pp. 712-736 (1992). Kernel order is maxPolyDegree + 2 if maxPolyDegree is even, and maxPolyDegree + 1 if maxPolyDegree is odd.

Due to accumulation of round-off errors, the calculation becomes unreliable for maxPolyDegree above 16 or so.

◆ isEqual()

virtual bool npstat::GaussianMixture1D::isEqual ( const AbsDistribution1D other) const
protectedvirtual

Derived classes should override the following method as long as they have at least one additional data member. Don't forget to call "isEqual" of the base class inside the derived classes.

Reimplemented from npstat::AbsScalableDistribution1D.

◆ mean()

double npstat::GaussianMixture1D::mean ( ) const

Mean of the whole mixture

◆ miseOptimalBw()

double npstat::GaussianMixture1D::miseOptimalBw ( unsigned  maxPolyDegree,
unsigned long  npoints,
double *  mise = 0 
) const

Bandwidth which minimizes the KDE MISE

◆ nentries()

unsigned npstat::GaussianMixture1D::nentries ( ) const
inline

Number of mixture components

◆ random()

virtual unsigned npstat::GaussianMixture1D::random ( AbsRandomGenerator g,
double *  r 
) const
virtual

Generate random numbers asscording to this distribution

Reimplemented from npstat::AbsScalableDistribution1D.

◆ stdev()

double npstat::GaussianMixture1D::stdev ( ) const

Standard deviation of the whole mixture


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