npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
RatioResponseIntervalBuilder.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_RATIORESPONSEINTERVALBUILDER_HH_
2 #define NPSTAT_RATIORESPONSEINTERVALBUILDER_HH_
3 
4 /*!
5 // \file RatioResponseIntervalBuilder.hh
6 //
7 // \brief Interval 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  // numeratorCut -- the cut imposed on the numerator of the ratio
33  // (assuming "numerator > cut" requirement). It is
34  // assumed that both numerator and denominator are
35  // positive.
36  //
37  // badFraction -- the maximum fraction of weights for which the
38  // distribution of the ratio will be distorted.
39  // These are all the weights to the left of the
40  // predictor value given by the ratio
41  // numeratorCut/(chosen ratioCut).
42  */
43  RatioResponseIntervalBuilder(unsigned denomDim,
44  double numeratorCut,
45  double badFraction);
46 
47  inline virtual ~RatioResponseIntervalBuilder() {}
48 
49  virtual Interval<double> makeResponseInterval(
50  unsigned long uniqueId,
51  const double* predictorCoords, unsigned nPredictors,
52  const BoxND<double>& predictorBox,
53  std::vector<typename Point::value_type>& data) const;
54 
55  virtual Interval<double> makeResponseIntervalW(
56  unsigned long uniqueId,
57  const double* predictorCoords, unsigned nPredictors,
58  const BoxND<double>& predictorBox, const WeightedPtrVec& data,
59  unsigned responseDimToUse) const;
60 
61  private:
62  unsigned predictorDim_;
63  double numeratorCut_;
64  double frac_;
65  };
66 }
67 
68 #include "npstat/stat/RatioResponseIntervalBuilder.icc"
69 
70 #endif // NPSTAT_RATIORESPONSEINTERVALBUILDER_HH_
Base class for building response boxes for univariate density estimation in the regression context.
Definition: AbsResponseIntervalBuilder.hh:23
Definition: Interval.hh:29
Definition: RatioResponseIntervalBuilder.hh:19
RatioResponseIntervalBuilder(unsigned denomDim, double numeratorCut, double badFraction)
Definition: AbsArrayProjector.hh:14