HALL A C++/ROOT Parity Analyzer Pan TaStatistics.cc (implementation) Author: R. Holmes <http://mep1.phy.syr.edu/~rsholmes>, A. Vacheret <http://www.jlab.org/~vacheret>, R. Michaels <http://www.jlab.org/~rom>, K.Paschke @(#)pan/src:$Name: $:$Id: TaStatistics.cc,v 1.9 2003/07/31 16:12:00 rsholmes Exp $ A general purpose statistics class, allowing accumulation of sums for one value or a set of values, from which quantities such as means, widths, errors, etc. can be computed. Note that this class permits a single-pass analysis with *no* attempt to reduce errors on the computed quantities. Such an analysis, using mathematically correct formulas, can still give badly erroneous results for RMS / variance / error due to roundoff problems. In particular, when N is large and the variance is small, mean(x^2)-(mean(x))^2 is a difference of two large numbers and can have very poor precision. Results can be improved by making an estimate of mean(x) and subtracting this from each x_i, but automating such an estimate is difficult. However, this class also allows 2-pass calculations to be made if desired, with greatly improved precision. Note that in practice the aforementioned roundoff problems have not been shown to be significant for HAPPEX data. For more on this subject see for example _The American Statistician_ V. 37 p. 242 (1982).
| TaStatistics(const TaStatistics& s) | |
| TaStatistics(const size_t nquant, const Bool_t goodErrors = true) | |
| virtual | ~TaStatistics() |
| static TClass* | Class() |
| vector<Double_t> | DataRMS() const |
| Double_t | DataRMS(const size_t i) const |
| void | DumpSums(const size_t i) const |
| virtual TClass* | IsA() const |
| vector<Double_t> | Mean() const |
| Double_t | Mean(const size_t i) const |
| vector<pair<Double_t,Double_t> > | MeanAndErr() const |
| pair<Double_t,Double_t> | MeanAndErr(const size_t i) const |
| vector<Double_t> | MeanErr() const |
| Double_t | MeanErr(const size_t i) const |
| vector<Double_t> | MeanVar() const |
| Double_t | MeanVar(const size_t i) const |
| Int_t | N() const |
| vector<Double_t> | Neff() const |
| Double_t | Neff(const size_t i) const |
| TaStatistics& | operator+=(const TaStatistics& s) |
| const TaStatistics& | operator=(const TaStatistics& s) |
| void | SetFirstPass(Bool_t) |
| virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
| size_t | Size() const |
| virtual void | Streamer(TBuffer& b) |
| void | StreamerNVirtual(TBuffer& b) |
| void | Update(const vector<Double_t>& x, const vector<Double_t>& xerr = vector<Double_t>(0), const vector<Double_t>& w = vector<Double_t>(0)) |
| void | Update(const Double_t x, const Double_t xerr = 0, const Double_t w = 0) |
| void | Zero() |
| Bool_t | fFirstPass | First or second pass? |
| Bool_t | fGoodErrors | update functions will pass good errors |
| Int_t | fN | sum of 1 (= N) |
| Int_t | fN2 | sum of 1 (= N) for second pass |
| vector<Double_t> | fSumWt | sum of weights |
| vector<Double_t> | fSumWt2 | sum of weights^2 |
| vector<Double_t> | fSumWt2Err2 | sum of weights^2 * error^2 |
| vector<Double_t> | fSumWtX | sum of weights * x |
| vector<Double_t> | fSumWtX2 | sum of weights * x^2 |
| vector<Double_t> | fSumWtXs | sum of weights * (x-<x>) |
| vector<Double_t> | fSumWtXs2 | sum of weights * (x-<x>)^2 |
| vector<Double_t> | fXbar | means of x from first pass |
| Inheritance Chart: | |||||
|