Jpp 19.3.0-rc.3
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. | |
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. | |
void | reset () |
Reset. | |
JQuantile & | add (const JQuantile &Q) |
Add quantile. | |
void | put (const double x, const double w=1.0) |
Put value. | |
template<class JElement_t , class JAllocator_t > | |
void | put (const array_type< JElement_t, JAllocator_t > &buffer, const double w=1.0) |
Put data. | |
long long int | getCount () const |
Get total count. | |
double | getTotal () const |
Get total weight. | |
double | getXmin () const |
Get minimum value. | |
double | getXmax () const |
Get maximum value. | |
double | getWmin () const |
Get minimum weight. | |
double | getWmax () const |
Get maximum weight. | |
double | getMean () const |
Get mean value. | |
double | getMean (const double value) const |
Get mean value. | |
double | getSTDev () const |
Get standard deviation. | |
double | getSTDev (const double value) const |
Get standard deviation. | |
double | getDeviation (const bool relative=true) const |
Get maximal deviation from average. | |
bool | hasAccuracy (const double precision) const |
Test relative accuracy. | |
double | getQuantile (const double Q, const Quantile_t option=forward_t) const |
Get quantile. | |
std::ostream & | print (std::ostream &out, bool lpr=true) const |
Print quantile. | |
const std::string & | getTitle () const |
Get title. | |
void | setTitle (const std::string &title) |
Set title. | |
JFirst_t & | mul (const JSecond_t &object) |
Multiply with object. | |
Static Protected Member Functions | |
template<class T > | |
static double | getQuantile (T __begin, T __end, const double W) |
Get quantile. | |
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. | |
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 |
Constructor.
title | title |
quantiles | quantiles |
Definition at line 53 of file JQuantile.hh.
|
inline |
Constructor.
title | title |
buffer | input data |
quantiles | quantiles |
w | weight |
Definition at line 71 of file JQuantile.hh.
|
inline |
Reset.
Definition at line 87 of file JQuantile.hh.
|
inline |
Put value.
x | value |
w | weight |
Definition at line 133 of file JQuantile.hh.
|
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.