npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::QuantileRegressionBase< Numeric > Class Template Referenceabstract

#include <LocalQuantileRegression.hh>

Inheritance diagram for npstat::QuantileRegressionBase< Numeric >:
npstat::QuantileRegressionOnKDTree< Point, Numeric > npstat::CensoredQuantileRegressionOnKDTree< Point, Numeric >

Public Member Functions

 QuantileRegressionBase (const QuadraticOrthoPolyND &poly, double quantile)
 
unsigned dim () const
 
double quantile () const
 
const QuadraticOrthoPolyNDgetPoly () const
 
const std::vector< double > & lastCoeffs () const
 
void setRegressionBox (const BoxND< Numeric > &box)
 
void setLinearMapping (const double *location, const double *scale, unsigned locationAndScaleArraySize)
 
void empiricalC0 (double *c0, double *c0Uncertainty, double *npoints)
 
double linearLoss (const double *coeffs, unsigned nCoeffs)
 

Protected Member Functions

void resetAccumulators ()
 

Protected Attributes

const QuadraticOrthoPolyNDpoly_
 
BoxND< Numeric > regressionBox_
 
std::vector< double > location_
 
std::vector< double > scale_
 
std::vector< double > coords_
 
std::vector< double > coeffs_
 
long double loss_
 
const double quantile_
 
const double onemq_
 
const unsigned mydim_
 

Detailed Description

template<class Numeric>
class npstat::QuantileRegressionBase< Numeric >

Base class for quantile regression

Member Function Documentation

◆ dim()

template<class Numeric >
unsigned npstat::QuantileRegressionBase< Numeric >::dim ( ) const
inline

Inspect object properties

◆ empiricalC0()

template<class Numeric >
void npstat::QuantileRegressionBase< Numeric >::empiricalC0 ( double *  c0,
double *  c0Uncertainty,
double *  npoints 
)

This method will provide a guess for the 0th order coefficient of the regression polynomial. It will also calculate the effective number of points inside the current regression box.

◆ linearLoss()

template<class Numeric >
double npstat::QuantileRegressionBase< Numeric >::linearLoss ( const double *  coeffs,
unsigned  nCoeffs 
)

This method calculates the function that has to be minimized; the minimization itself is up to some external optimization engine.

◆ setLinearMapping()

template<class Numeric >
void npstat::QuantileRegressionBase< Numeric >::setLinearMapping ( const double *  location,
const double *  scale,
unsigned  locationAndScaleArraySize 
)

This method sets up a mapping from the fitted region into the region which was used to create the orthogonal polynomials. The mapping is linear in every coordinate separately: ortho[i] = fitted[i]*scale[i] + location[i]. Note that the "setRegressionBox" method automatically sets up the default mapping which will be adequate for most applications.

◆ setRegressionBox()

template<class Numeric >
void npstat::QuantileRegressionBase< Numeric >::setRegressionBox ( const BoxND< Numeric > &  box)

Only the data inside the regression box will be used in the fit (and some points may be subsequently weighted down to zero by the weigh function).

Note that the "setRegressionBox" method automatically sets up the standard mapping: the edges of the regression box are mapped into the boundaries which were used to create the orthogonal polynomials. If the standard mapping is not what you want (for example, this might be the case near the boundaries of the fitted region), you must call "setLinearMapping" after calling "setRegressionBox" in order to override the standard mapping.

This method must be called at least once after the object is constructed and before any call to "linearLoss".


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