npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
minuitLocalQuantileRegression1D.hh
Go to the documentation of this file.
1 #ifndef NPSI_MINUITLOCALQUANTILEREGRESSION1D_HH_
2 #define NPSI_MINUITLOCALQUANTILEREGRESSION1D_HH_
3 
4 /*!
5 // \file minuitLocalQuantileRegression1D.hh
6 //
7 // \brief Local quantile regression with single predictor
8 //
9 // Author: I. Volobouev
10 //
11 // April 2011
12 */
13 
14 #include <vector>
15 #include <utility>
16 
17 namespace npsi {
18  /**
19  // High-level driver functions for performing local 1-d quantile
20  // regression fits using Minuit2 as a minimization engine
21  //
22  // The arguments are as follows:
23  //
24  // inputPoints -- are the points for which the regression should be
25  // performed. Predictor is the first member of the pair
26  // and response is the second. As a side effect of this
27  // function, the input points will be sorted in the
28  // increasing order. This is why the vector of input
29  // points is non-const.
30  //
31  // symbetaPower -- the power parameter for "SymmetricBeta1D". 3 and 4
32  // are good values to try.
33  //
34  // bandwidthInCDFSpace -- Approximate fraction of sample points which
35  // will participate in each fit. Due to robustness
36  // requirements (obtaining limited bandwidth in
37  // coordinate space), the bandwidth in the CDF space
38  // must be less than 0.5 (and, of course, positive).
39  //
40  // polyDegree -- this defines the degree of the polynomial that
41  // will be fitted to the quantile curve. It does not
42  // make much sense to go beyond 3 here.
43  //
44  // cdfValue -- which quantile to use in the regression
45  //
46  // xmin, xmax -- the result will be calculated between xmin and xmax
47  // in equidistant steps
48  //
49  // result -- array where the result will be stored
50  //
51  // nResultPoints -- number of coordinate points to use to build the
52  // result. The interval (xmin, xmax) will be split
53  // into "nResultPoints" bins. The coordinates at which
54  // the fits are performed are taken from the middle
55  // of those bins (as in a histogram). Naturally, array
56  // "result" must have at least "nResultPoints" elements.
57  //
58  // verbose -- this switch can be turned on for debugging purposes
59  */
60  template<class Numeric1, class Numeric2>
62  std::vector<std::pair<Numeric1,Numeric1> > inputPoints,
63  double symbetaPower, double bandwidthInCDFSpace,
64  unsigned polyDegree, double cdfValue, double xmin, double xmax,
65  Numeric2* result, unsigned nResultPoints, bool verbose=false);
66 }
67 
68 #include "npstat/interfaces/minuitLocalQuantileRegression1D.icc"
69 
70 #endif // NPSI_MINUITLOCALQUANTILEREGRESSION1D_HH_
Definition: fitCompositeJohnson.hh:16
void minuitLocalQuantileRegression1D(std::vector< std::pair< Numeric1, Numeric1 > > inputPoints, double symbetaPower, double bandwidthInCDFSpace, unsigned polyDegree, double cdfValue, double xmin, double xmax, Numeric2 *result, unsigned nResultPoints, bool verbose=false)