Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Return sample quantiles corresponding to the given probabilities.
The smallest observation corresponds to a probability of 0 and the largest to a probability of 1.
Implements algorithm 7 from Hyndman, R. J. and Fan, Y., Sample quantiles in Statistical Packages (R's default quantile function)
T | An Eigen type with either fixed rows or columns at compile time, or std::vector<double> |
Tp | Type of probabilities vector |
samples_vec | Numeric vector whose sample quantiles are wanted |
ps | Vector of probability with value between 0 and 1. |
std::invalid_argument | If any of the values are NaN or size 0. |
std::domain_error | If p<0 or p>1 for any p in ps. |
Definition at line 81 of file quantile.hpp.