|
Jpp
19.1.0-rc.1
the software that should make you happy
|
Auxiliary data structure for running average, standard deviation and quantiles. More...
#include <JQuantile.hh>
Public Types | |
| enum | Quantile_t { forward_t = +1 , symmetric_t = 0 , backward_t = -1 } |
| Options for evaluation of quantile. More... | |
Public Member Functions | |
| JQuantile (const JTitle &title="", const bool quantiles=false) | |
| Constructor. More... | |
| template<class JElement_t , class JAllocator_t > | |
| JQuantile (const JTitle &title, const array_type< JElement_t, JAllocator_t > &buffer, const bool quantiles=false, const double w=1.0) | |
| Constructor. More... | |
| void | reset () |
| Reset. More... | |
| JQuantile & | add (const JQuantile &Q) |
| Add quantile. More... | |
| void | put (const double x, const double w=1.0) |
| Put value. More... | |
| template<class JElement_t , class JAllocator_t > | |
| void | put (const array_type< JElement_t, JAllocator_t > &buffer, const double w=1.0) |
| Put data. More... | |
| long long int | getCount () const |
| Get total count. More... | |
| double | getTotal () const |
| Get total weight. More... | |
| double | getXmin () const |
| Get minimum value. More... | |
| double | getXmax () const |
| Get maximum value. More... | |
| double | getWmin () const |
| Get minimum weight. More... | |
| double | getWmax () const |
| Get maximum weight. More... | |
| double | getMean () const |
| Get mean value. More... | |
| double | getMean (const double value) const |
| Get mean value. More... | |
| double | getSTDev () const |
| Get standard deviation. More... | |
| double | getSTDev (const double value) const |
| Get standard deviation. More... | |
| double | getDeviation (const bool relative=true) const |
| Get maximal deviation from average. More... | |
| bool | hasAccuracy (const double precision) const |
| Test relative accuracy. More... | |
| double | getQuantile (const double Q, const Quantile_t option=forward_t) const |
| Get quantile. More... | |
| std::ostream & | print (std::ostream &out, bool lpr=true) const |
| Print quantile. More... | |
| const std::string & | getTitle () const |
| Get title. More... | |
| void | setTitle (const std::string &title) |
| Set title. More... | |
| JFirst_t & | mul (const JSecond_t &object) |
| Multiply with object. More... | |
Static Protected Member Functions | |
| template<class T > | |
| static double | getQuantile (T __begin, T __end, const double W) |
| Get quantile. More... | |
Protected Attributes | |
| bool | quantiles |
| double | mean |
| double | sigma |
| double | total |
| long long int | count |
| double | xmin |
| double | xmax |
| double | wmin |
| double | wmax |
| std::multimap< double, double > | buffer |
| std::string | title |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const JQuantile &quantile) |
| Print quantile. More... | |
Auxiliary data structure for running average, standard deviation and quantiles.
See Knuth TAOCP vol 2, 3rd edition, page 232.
This class acts as a zero-dimensional histogram.
Note that if a weight is used, it should strictly be positive.
Definition at line 43 of file JQuantile.hh.
Options for evaluation of quantile.
| Enumerator | |
|---|---|
| forward_t | forward |
| symmetric_t | symmatric |
| backward_t | backward |
Definition at line 335 of file JQuantile.hh.
|
inline |
|
inline |
Constructor.
| title | title |
| buffer | input data |
| quantiles | quantiles |
| w | weight |
Definition at line 71 of file JQuantile.hh.
|
inline |
Add quantile.
| Q | quantile |
Definition at line 108 of file JQuantile.hh.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get mean value.
Definition at line 252 of file JQuantile.hh.
|
inline |
Get mean value.
| value | default value |
Definition at line 267 of file JQuantile.hh.
|
inline |
|
inline |
Get standard deviation.
| value | default value |
Definition at line 296 of file JQuantile.hh.
|
inline |
Get maximal deviation from average.
| relative | if true, relative to average, else absolute |
Definition at line 311 of file JQuantile.hh.
|
inline |
Test relative accuracy.
| precision | relative precision |
Definition at line 326 of file JQuantile.hh.
|
inline |
Get quantile.
| Q | quantile |
| option | option |
Definition at line 349 of file JQuantile.hh.
|
inline |
Print quantile.
| out | output stream |
| lpr | long print |
Definition at line 382 of file JQuantile.hh.
|
inlinestaticprotected |
Get quantile.
| __begin | begin of data |
| __end | end of data |
| W | weight |
Definition at line 426 of file JQuantile.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
friend |
Print quantile.
| out | output stream |
| quantile | quantile |
Definition at line 411 of file JQuantile.hh.
|
protected |
Definition at line 443 of file JQuantile.hh.
|
protected |
Definition at line 444 of file JQuantile.hh.
|
protected |
Definition at line 445 of file JQuantile.hh.
|
protected |
Definition at line 446 of file JQuantile.hh.
|
protected |
Definition at line 447 of file JQuantile.hh.
|
protected |
Definition at line 448 of file JQuantile.hh.
|
protected |
Definition at line 449 of file JQuantile.hh.
|
protected |
Definition at line 450 of file JQuantile.hh.
|
protected |
Definition at line 451 of file JQuantile.hh.
|
protected |
Definition at line 452 of file JQuantile.hh.