yat
0.20.3pre
|
#include <yat/statistics/PercentileConfidenceInterval.h>
Public Member Functions | |
PercentileConfidenceInterval (double k, double level) | |
template<typename RandomAccessIterator > | |
void | operator() (RandomAccessIterator first, RandomAccessIterator last, bool sorted=false) |
double | alpha (void) const |
double | lower (void) const |
double | k (void) const |
double | upper (void) const |
Class calculates the confidence interval. It follows the method suggested by Martin Bland in An Introduction to Medical Statistics and <a href="https://www-users.york.ac.uk/~mb55/intro/cicent.htm">here, but uses the exact binomial distribution instead of a large-sample normal approximation.
You need to load the class with data via the operator() before the interval is available via the lower(void) and upper(void functions.
A weighted input is currently not supported.
theplu::yat::statistics::PercentileConfidenceInterval::PercentileConfidenceInterval | ( | double | k, |
double | level | ||
) |
k | The kth percentile, for example, 50 for median |
level | Confidence level, for example, 0.95 for 95% confidence interval |
double theplu::yat::statistics::PercentileConfidenceInterval::alpha | ( | void | ) | const |
double theplu::yat::statistics::PercentileConfidenceInterval::k | ( | void | ) | const |
For example, 50, for median.
double theplu::yat::statistics::PercentileConfidenceInterval::lower | ( | void | ) | const |
|
inline |
first | First element in range |
last | One past element in range |
sorted | if true the range is assumed to be sorted; otherwise the range is copied, the copy sorted, before the confidence interval calculated. |
Type Requirements:
RandomAccessIterator
must be a Random Access Traversal IteratorRandomAccessIterator
must be a Readable Iteratorvalue_type
of RandomAccessIterator is convertible to double
double theplu::yat::statistics::PercentileConfidenceInterval::upper | ( | void | ) | const |