#include <algorithm>
#include "mcmc++/intervals.h"
Include dependency graph for intervals.cpp:

Go to the source code of this file.
Functions | |
| double | quantile (vector< double > &ox, const double p) |
| double | p_value (vector< double > &x, const double p) |
| vector< double > | hpd (vector< double > &x, const double p) |
Definition in file intervals.cpp.
| vector<double> hpd | ( | vector< double > & | x, | |
| const double | p | |||
| ) |
Returns HPD interval, low in x[0], high in x[1].
Returns lower limit of HPD interval in first element of vector, upper limit of HPD interval in second element of vector. This method is an implementation of the Chen-Shao HPD estimation algorithm.
Notice that as a side effect of calling this routine, the input vector is sorted.
| x | The vector | |
| p | The credible interval desired, e.g., 0.95 for 95% |
Definition at line 95 of file intervals.cpp.
| double p_value | ( | vector< double > & | x, | |
| const double | p | |||
| ) |
Returns P(x <= p).
Notice that as a side effect of calling this routine, the input vector is sorted.
| x | The vector | |
| p | The desired P-value |
Definition at line 72 of file intervals.cpp.
| double quantile | ( | vector< double > & | ox, | |
| const double | p | |||
| ) |
Returns the sample quantile corresponding to p.
This implementation corresponds to Type 8 continuous sample types of Hyndman and Fan (American Statistician, 50:361-365; 1996)
Notice that as a side effect of calling this routine, the input vector is sorted.
| ox | The vector from which to calculate the quantile | |
| p | The desired quantile |
Definition at line 46 of file intervals.cpp.
Referenced by Model::ReportDic(), and Model::Summarize().
1.5.1