|
Jpp
15.0.0-rc.2
the software that should make you happy
|
Auxiliary data structure for running average, standard deviation and quantiles. More...
#include <JQuantile.hh>
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 | getSTDev () 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 bool reverse=false) 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.
|
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 |
Put data.
| buffer | input data |
| w | weight |
Definition at line 172 of file JQuantile.hh.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get mean value.
Definition at line 252 of file JQuantile.hh.
|
inline |
Get standard deviation.
Definition at line 266 of file JQuantile.hh.
|
inline |
Get maximal deviation from average.
| relative | if true, relative to average, else absolute |
Definition at line 281 of file JQuantile.hh.
|
inline |
Test relative accuracy.
| precision | relative precision |
Definition at line 296 of file JQuantile.hh.
|
inline |
Get quantile.
| Q | quantile |
| reverse | reverse |
Definition at line 309 of file JQuantile.hh.
|
inline |
Print quantile.
| out | output stream |
| lpr | long print |
Definition at line 335 of file JQuantile.hh.
|
inlinestaticprotected |
Get quantile.
| __begin | begin of data |
| __end | end of data |
| W | weight |
Definition at line 379 of file JQuantile.hh.
|
inlineinherited |
Get title.
|
inlineinherited |
Set title.
| title | title |
|
inlineinherited |
Multiply with object.
| object | object |
Definition at line 357 of file JMath.hh.
|
friend |
Print quantile.
| out | output stream |
| quantile | quantile |
Definition at line 364 of file JQuantile.hh.
|
protected |
Definition at line 396 of file JQuantile.hh.
|
protected |
Definition at line 397 of file JQuantile.hh.
|
protected |
Definition at line 398 of file JQuantile.hh.
|
protected |
Definition at line 399 of file JQuantile.hh.
|
protected |
Definition at line 400 of file JQuantile.hh.
|
protected |
Definition at line 401 of file JQuantile.hh.
|
protected |
Definition at line 402 of file JQuantile.hh.
|
protected |
Definition at line 403 of file JQuantile.hh.
|
protected |
Definition at line 404 of file JQuantile.hh.
|
protected |
Definition at line 405 of file JQuantile.hh.
1.8.5