npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
fitCompositeJohnson.hh
Go to the documentation of this file.
1 #ifndef NPSI_FITCOMPOSITEJOHNSON_HH_
2 #define NPSI_FITCOMPOSITEJOHNSON_HH_
3 
4 /*!
5 // \file fitCompositeJohnson.hh
6 //
7 // \brief Nonparametric density estimation utilizing Johnson transformation
8 //
9 // Author: I. Volobouev
10 //
11 // September 2010
12 */
13 
15 
16 namespace npsi {
17  /**
18  // Density estimation by the transformation method using the following
19  // sequence of steps:
20  //
21  // 1. Johnson system is fitted to the input sample between quantiles
22  // that correspond to parameters "qmin" and "qmax". Typical values
23  // of these parameters are 0.05 and 0.95.
24  //
25  // 2. The sample is transformed according to the cumulative distribution
26  // of the fitted Johnson system.
27  //
28  // 3. The transformed sample is smoothed with a bunch of filters with
29  // different bandwidth values. The best filter (bandwidh) is then
30  // chosen using pseudo-likelihood cross-vaidation.
31  //
32  // 4. BinnedCompositeJohnson density is made using the results of these
33  // fits. This density is scanned into the "smoothedCurve" array.
34  //
35  // Function arguments are as follows:
36  //
37  // input, nInput -- Array of input data points (typically
38  // floats or doubles) and the number of
39  // points in this array.
40  //
41  // nBins -- Number of bins for the histogram which
42  // will be used for fitting parameters of
43  // the Johnson system.
44  //
45  // xmin, xmax -- Range (support) of the estimated density.
46  //
47  // qmin, qmax, minlog -- Parameters passed to the JohnsonFit class.
48  //
49  // filters, nFilters -- A collection of smoothers to try on the
50  // transformed density. All of them will be
51  // used and the smoother with the best
52  // cross-validation pseudo-likelihood will
53  // be chosen to build the final result.
54  //
55  // smoothedCurve, lenCurve -- The array in which the smoothed values
56  // will be stored. The coordinates correspond
57  // to the bin centers of a histogram with
58  // "lenCurve" bins between "xmin" and "xmax".
59  //
60  // intitialFitConverged -- Can be used to find out whether the initial
61  // Johnson system fit converged successfully.
62  // This parameter can also be NULL.
63  //
64  // filterUsed -- On output, will contain the number of the
65  // best filter from "filters" (or can be NULL).
66  */
67  template<typename InputData, typename OutputData>
69  const InputData* input, unsigned long nInput,
70  unsigned nBins, double xmin, double xmax,
71  double qmin, double qmax, double minlog,
72  const npstat::LocalPolyFilter1D* const* filters, unsigned nFilters,
73  OutputData* smoothedCurve, unsigned lenCurve,
74  bool* intitialFitConverged, unsigned* filterUsed);
75 }
76 
77 #include "npstat/interfaces/fitCompositeJohnson.icc"
78 
79 #endif // NPSI_FITCOMPOSITEJOHNSON_HH_
Local polynomial filtering (regression) on 1-d equidistant grids.
Definition: LocalPolyFilter1D.hh:38
Definition: fitCompositeJohnson.hh:16
void fitCompositeJohnson(const InputData *input, unsigned long nInput, unsigned nBins, double xmin, double xmax, double qmin, double qmax, double minlog, const npstat::LocalPolyFilter1D *const *filters, unsigned nFilters, OutputData *smoothedCurve, unsigned lenCurve, bool *intitialFitConverged, unsigned *filterUsed)