npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
RatioResponseBoxBuilder.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_RATIORESPONSEBOXBUILDER_HH_
2 #define NPSTAT_RATIORESPONSEBOXBUILDER_HH_
3 
4 /*!
5 // \file RatioResponseBoxBuilder.hh
6 //
7 // \brief Box for a ratio response variable with a cut on the numerator
8 //
9 // Author: I. Volobouev
10 //
11 // July 2015
12 */
13 
15 
16 namespace npstat {
17  template <class Point>
19  {
20  public:
22  typedef typename B::WeightedPointPtr WeightedPointPtr;
23  typedef typename B::WeightedPtrVec WeightedPtrVec;
24 
25  /**
26  // The constructor arguments are as follows:
27  //
28  // denomDim -- the dimension number of the predictor variable
29  // used as the ratio denominator inside the Point
30  // class
31  //
32  // ratioDim -- the dimension number (inside the Point class)
33  // of the ratio variable itself
34  //
35  // numeratorCut -- the cut imposed on the numerator of the ratio
36  // (assuming "numerator > cut" requirement). It is
37  // assumed that both numerator and denominator are
38  // positive.
39  //
40  // badFraction -- the maximum fraction of weights for which the
41  // distribution of the ratio will be distorted.
42  // These are all the weights to the left of the
43  // predictor value given by the ratio
44  // numeratorCut/(chosen ratioCut).
45  */
46  RatioResponseBoxBuilder(unsigned denomDim,
47  unsigned ratioDim,
48  double numeratorCut,
49  double badFraction);
50 
51  inline virtual ~RatioResponseBoxBuilder() {}
52 
53  virtual BoxND<double> makeResponseBox(
54  unsigned long uniqueId,
55  const double* predictorCoords, unsigned nPredictors,
56  const BoxND<double>& predictorBox,
57  std::vector<OrderedPointND<Point> >& data) const;
58 
59  virtual BoxND<double> makeResponseBoxW(
60  unsigned long uniqueId,
61  const double* predictorCoords, unsigned nPredictors,
62  const BoxND<double>& predictorBox, const WeightedPtrVec& data,
63  const unsigned* dimsToUse, unsigned nDimsToUse) const;
64 
65  private:
66  unsigned predictorDim_;
67  unsigned ratioDim_;
68  double numeratorCut_;
69  double frac_;
70  };
71 }
72 
73 #include "npstat/stat/RatioResponseBoxBuilder.icc"
74 
75 #endif // NPSTAT_RATIORESPONSEBOXBUILDER_HH_
Base class for building response boxes for multivariate density estimation in regression context.
Definition: AbsResponseBoxBuilder.hh:23
Definition: OrderedPointND.hh:40
Definition: RatioResponseBoxBuilder.hh:19
RatioResponseBoxBuilder(unsigned denomDim, unsigned ratioDim, double numeratorCut, double badFraction)
Definition: AbsArrayProjector.hh:14