npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0

#include <UnitMapInterpolationND.hh>

Inheritance diagram for npstat::UnitMapInterpolationND:
npstat::AbsInterpolationAlgoND npstat::AbsDistributionND

Public Member Functions

 UnitMapInterpolationND (unsigned dim, unsigned nInterpolated)
 
virtual UnitMapInterpolationNDclone () const
 
bool mappedByQuantiles () const
 
void add (const AbsDistributionND &d, double weight)
 
void replace (unsigned i, const AbsDistributionND &d, double weight)
 
void setWeight (unsigned i, double weight)
 
void clear ()
 
void normalizeAutomatically (bool allow)
 
unsigned size () const
 
double density (const double *x, unsigned dim) const
 
void unitMap (const double *rnd, unsigned dim, double *x) const
 
virtual gs::ClassId classId () const
 
- Public Member Functions inherited from npstat::AbsInterpolationAlgoND
 AbsInterpolationAlgoND (const unsigned dim)
 
- Public Member Functions inherited from npstat::AbsDistributionND
 AbsDistributionND (const unsigned dim)
 
 AbsDistributionND (const AbsDistributionND &r)
 
AbsDistributionNDoperator= (const AbsDistributionND &r)
 
bool operator== (const AbsDistributionND &r) const
 
bool operator!= (const AbsDistributionND &r) const
 
unsigned dim () const
 
virtual unsigned random (AbsRandomGenerator &g, double *x, unsigned lenX) const
 
virtual bool write (std::ostream &) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
- Static Public Member Functions inherited from npstat::AbsDistributionND
static const char * classname ()
 
static unsigned version ()
 
static AbsDistributionNDread (const gs::ClassId &id, std::istream &)
 

Protected Member Functions

virtual bool isEqual (const AbsDistributionND &) const
 

Additional Inherited Members

- Protected Attributes inherited from npstat::AbsDistributionND
const unsigned dim_
 

Detailed Description

This class interpolates multivariate statistical distributions by conditional quantiles (which is a particular mapping from the unit cube into the density support region). Interpolation weights are to be calculated outside of this class.

Constructor & Destructor Documentation

◆ UnitMapInterpolationND()

npstat::UnitMapInterpolationND::UnitMapInterpolationND ( unsigned  dim,
unsigned  nInterpolated 
)

The first constructor argument is the dimensionality of the density support, the second is the number of distributions which will be used in the interpolation. That number, in general, will depend on the dimensionality of the parameter space. After the object is constructed, the distributions should be added with the "add" method. It is possible to add more than "nInterpolated" distributions (which will result in a slightly less efficient code), however the user must add at least "nInterpolated" distributions before calling the "density" method. All interpolated distributions must have their unit cube mapping implemented by conditional quantiles (so that their "mappedByQuantiles" method returns "true").

This class does not make copies of the interpolated distributions and works with references and pointers (making internal copies would result in a significant performance hit in a variety of typical situations). This means that all added distributions must still exist while this object is in use. It is the responsibility of the user of this class to make sure that this is indeed the case.

Member Function Documentation

◆ add()

void npstat::UnitMapInterpolationND::add ( const AbsDistributionND d,
double  weight 
)
virtual

In this method, "d" must refer to a distribution for which "mappedByQuantiles" method returns "true".

Implements npstat::AbsInterpolationAlgoND.

◆ classId()

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

Method needed for "geners" I/O

Implements npstat::AbsDistributionND.

◆ clear()

void npstat::UnitMapInterpolationND::clear ( )
virtual

Clear all the terms in the weighted sum

Implements npstat::AbsInterpolationAlgoND.

◆ clone()

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

"Virtual copy constructor"

Implements npstat::AbsInterpolationAlgoND.

◆ density()

double npstat::UnitMapInterpolationND::density ( const double *  x,
unsigned  dim 
) const
virtual

Probability density

Implements npstat::AbsDistributionND.

◆ mappedByQuantiles()

bool npstat::UnitMapInterpolationND::mappedByQuantiles ( ) const
inlinevirtual

The following method should return "true" in case the "unitMap" method is implemented by a sequence of conditional quantile functions. Distributions with such maps permit quantile-based interpolation procedures.

Implements npstat::AbsDistributionND.

◆ normalizeAutomatically()

void npstat::UnitMapInterpolationND::normalizeAutomatically ( bool  allow)
virtual

This method should be called to disable (and later enable) automatic weight normalization if you want to use the "setWeight" or "replace" methods many times and, especially, if at some point in this process the sum of the weights becomes zero. The "density" and "unitMap" methods can not be called if normalization is not enabled.

Implements npstat::AbsInterpolationAlgoND.

◆ setWeight()

void npstat::UnitMapInterpolationND::setWeight ( unsigned  i,
double  weight 
)
virtual

Set the weight for the given term in the weighted sum

Implements npstat::AbsInterpolationAlgoND.

◆ size()

unsigned npstat::UnitMapInterpolationND::size ( ) const
inlinevirtual

The number of terms in the weighted sum

Implements npstat::AbsInterpolationAlgoND.

◆ unitMap()

void npstat::UnitMapInterpolationND::unitMap ( const double *  rnd,
unsigned  bufLen,
double *  x 
) const
virtual

Mapping from the unit hypercube into the density support region. Note that "bufLen" does not have to be equal to the dimensionality of the function. There may be an efficient way to generate just the leading dimensions in case "bufLen" is smaller than the dimensionality.

Implements npstat::AbsDistributionND.


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