yat  0.21pre
Public Member Functions | List of all members
theplu::yat::statistics::PercentileConfidenceInterval Class Reference

#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
 

Detailed Description

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.

Since
New in yat 0.19

Constructor & Destructor Documentation

◆ PercentileConfidenceInterval()

theplu::yat::statistics::PercentileConfidenceInterval::PercentileConfidenceInterval ( double  k,
double  level 
)
Parameters
kThe kth percentile, for example, 50 for median
levelConfidence level, for example, 0.95 for 95% confidence interval

Member Function Documentation

◆ alpha()

double theplu::yat::statistics::PercentileConfidenceInterval::alpha ( void  ) const
Returns
alpha, for example 95 for 95% confidence interval

◆ k()

double theplu::yat::statistics::PercentileConfidenceInterval::k ( void  ) const

For example, 50, for median.

◆ lower()

double theplu::yat::statistics::PercentileConfidenceInterval::lower ( void  ) const
Returns
lower confidence interval

◆ operator()()

template<typename RandomAccessIterator >
void theplu::yat::statistics::PercentileConfidenceInterval::operator() ( RandomAccessIterator  first,
RandomAccessIterator  last,
bool  sorted = false 
)
inline
Parameters
firstFirst element in range
lastOne past element in range
sortedif true the range is assumed to be sorted; otherwise the range is copied, the copy sorted, before the confidence interval calculated.

Type Requirements:

◆ upper()

double theplu::yat::statistics::PercentileConfidenceInterval::upper ( void  ) const
Returns
upper confidence interval

The documentation for this class was generated from the following file:

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14