npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
minuitQuantileRegression.hh
Go to the documentation of this file.
1 #ifndef NPSI_MINUITQUANTILEREGRESSION_HH_
2 #define NPSI_MINUITQUANTILEREGRESSION_HH_
3 
4 /*!
5 // \file minuitQuantileRegression.hh
6 //
7 // \brief Local quantile regression with multiple predictors
8 //
9 // Author: I. Volobouev
10 //
11 // October 2011
12 */
13 
15 
16 namespace npsi {
17  /**
18  // High-level driver function for performing local quantile regression
19  // fits using Minuit2 as a minimization engine. The weight function is
20  // assumed to be symmetric in each dimension.
21  //
22  // Function arguments are as follows:
23  //
24  // qrb -- Naturally, an instance of the
25  // npstat::QuantileRegressionBase template.
26  // Carries the information about the dataset,
27  // the kernel, the bandwidth, and the quantile
28  // to fit for. For more details, look at the
29  // LocalQuantileRegression.hh header.
30  //
31  // polyDegree -- Degree of the local polynomial to fit.
32  // Can be 0, 1 (local linear regression),
33  // or 2 (local quadratic regression).
34  //
35  // result -- Grid which will hold the results on exit.
36  // It defines the number of points in each
37  // dimension and provides the storage space.
38  //
39  // resultBox -- Coordinates of the grid boundaries. The
40  // points for which the regression is performed
41  // will be positioned inside this box just like
42  // histogram bin centers.
43  //
44  // reportProgressEvery -- Print out a message about the number of
45  // grid points processed to the standard output
46  // every "reportProgressEvery" points. The
47  // default value of 0 means that such printouts
48  // are disabled.
49  //
50  // upFactor -- A factor for the Minuit UP parameter, to
51  // multiply by the value estimated internally.
52  // Don't change the default unless you really
53  // understand what you are doing.
54  //
55  // For this function, it is assumed that the constant bandwidth is
56  // set up already, with the weight function which was used to create
57  // the orthogonal polynomials.
58  */
59  template <typename Numeric,
60  typename Num2, unsigned StackLen2, unsigned StackDim2>
62  npstat::QuantileRegressionBase<Numeric>& qrb, unsigned polyDegree,
64  const npstat::BoxND<Numeric>& resultBox,
65  unsigned reportProgressEvery = 0, double upFactor = 1.0);
66 
67  /**
68  // High-level driver function for performing local quantile regression
69  // fits using Minuit2 as a minimization engine. The weight function is
70  // assumed to be symmetric in each dimension.
71  //
72  // This function is similar to minuitQuantileRegression. However,
73  // it sometimes automatically increases the bandwidth: it makes sure
74  // that the regression box has at least the minimal fraction of
75  // points inside it, as specified by the "minimalSampleFraction"
76  // parameter. The fraction is calculated from the "predictorHisto"
77  // histogram whose dimensionality and axis order should coincide
78  // with the regression predictors. It is expected that this histogram
79  // will contain the predictor variables for the sample actually used
80  // in the regression.
81  //
82  // "minimalSampleFraction" must be <= 1.0. 0 or negative values
83  // will result in the constant bandwidth use, just like in the
84  // minuitQuantileRegression function.
85  */
86  template
87  <
88  typename Numeric,
89  typename Num2, unsigned StackLen2, unsigned StackDim2,
90  typename NumHisto
91  >
93  npstat::QuantileRegressionBase<Numeric>& qrb, unsigned polyDegree,
95  const npstat::BoxND<Numeric>& resultBox,
96  const npstat::HistoND<NumHisto>& predictorHisto,
97  double minimalSampleFraction,
98  unsigned reportProgressEvery = 0, double upFactor = 1.0);
99 }
100 
101 #include "npstat/interfaces/minuitQuantileRegression.icc"
102 
103 #endif // NPSI_MINUITQUANTILEREGRESSION_HH_
Facilities for performing local linear and quadratic quantile regression.
Definition: ArrayND.hh:93
Definition: HistoND.hh:46
Definition: LocalQuantileRegression.hh:34
Definition: fitCompositeJohnson.hh:16
void minuitQuantileRegressionIncrBW(npstat::QuantileRegressionBase< Numeric > &qrb, unsigned polyDegree, npstat::ArrayND< Num2, StackLen2, StackDim2 > *result, const npstat::BoxND< Numeric > &resultBox, const npstat::HistoND< NumHisto > &predictorHisto, double minimalSampleFraction, unsigned reportProgressEvery=0, double upFactor=1.0)
void minuitQuantileRegression(npstat::QuantileRegressionBase< Numeric > &qrb, unsigned polyDegree, npstat::ArrayND< Num2, StackLen2, StackDim2 > *result, const npstat::BoxND< Numeric > &resultBox, unsigned reportProgressEvery=0, double upFactor=1.0)
Definition: BoxND.hh:25