Skip to content

Commit 7c3f956

Browse files
committed
update quantile function
closes #50
1 parent ae039bc commit 7c3f956

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

functions/inverse_cdf/icdf_definition.stan

Lines changed: 0 additions & 9 deletions
This file was deleted.

functions/inverse_cdf/johnson_quantile_icdf.stan renamed to functions/quantile_function/johnson_qf.stan

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
/** @addtogroup johnson_quantile_icdf Johnson Quantile Parameterized Distributions (J-QPD) functions
1+
/** @addtogroup johnson_qf Johnson Quantile Parameterized Distributions (J-QPD) functions
22
*
33
* Christopher C. Hadlock, J. Eric Bickel
44
* The Generalized Johnson Quantile-Parameterized Distribution System.
55
* Decision Analysis 16 (1) 67-85 https://doi.org/10.1287/deca.2018.0376
66
*
7-
* \ingroup icdf
7+
* \ingroup qf
88
* @{ */
99

1010
/**
11-
* Inverse CDF of the J-QPD-S semi-bounded distribution, which has moments
11+
* Quantile function of the J-QPD-S semi-bounded distribution, which has moments
1212
*
1313
* \f{aligned}{
1414
* F^{-1}(p, l, x_\alpha) =
@@ -45,7 +45,7 @@
4545
* @throws reject if \f$ \alpha \notin [0, 1] \f$
4646
* @throws reject if quantiles \f$ \ne 3\f$
4747
*/
48-
real JQPDS_icdf(real p, real lower_bound, data real alpha, vector quantiles) {
48+
real JQPDS_qf(real p, real lower_bound, data real alpha, vector quantiles) {
4949
if (p < 0 || p > 1) reject("p must be between 0 and 1");
5050
if (alpha < 0 || alpha > 1) reject("alpha must be between 0 and 1");
5151
if (rows(quantiles) != 3) reject("quantiles must have three elements");
@@ -88,7 +88,7 @@
8888
}
8989

9090
/**
91-
* Inverse CDF of the J-QPD-S-II semi-bounded distribution, which lacks moments
91+
* Quantile function of the J-QPD-S-II semi-bounded distribution, which lacks moments
9292
*
9393
* \f{aligned}{
9494
* F^{-1}(p, l, x_\alpha) =
@@ -124,7 +124,7 @@
124124
* @throws reject if \f$ \alpha \notin [0, 1] \f$
125125
* @throws reject if quantiles \f$ \ne 3\f$
126126
*/
127-
real JQPDS2_icdf(real p, real lower_bound, data real alpha, vector quantiles) {
127+
real JQPDS2_qf(real p, real lower_bound, data real alpha, vector quantiles) {
128128
if (p < 0 || p > 1) reject("p must be between 0 and 1");
129129
if (alpha < 0 || alpha > 1) reject("alpha must be between 0 and 1");
130130
if (rows(quantiles) != 3) reject("quantiles must have three elements");
@@ -158,7 +158,7 @@
158158
}
159159

160160
/**
161-
* Inverse CDF of the J-QPD-B bounded distribution
161+
* Quantile function of the J-QPD-B bounded distribution
162162
*
163163
* \f{aligned}{
164164
* F^{-1}(p, u, l, x_\alpha) =
@@ -195,7 +195,7 @@
195195
* @throws reject if \f$ \alpha \notin [0, 1] \f$
196196
* @throws reject if quantiles \f$ != 3\f$
197197
*/
198-
real JQPDB_icdf(real p, row_vector bounds, data real alpha, vector quantiles) {
198+
real JQPDB_qf(real p, row_vector bounds, data real alpha, vector quantiles) {
199199
if (cols(bounds) != 2) reject("bounds must have two elements");
200200
if (bounds[2] == positive_infinity()) {
201201
return JQPDS2_icdf(p, alpha, bounds[1], quantiles);

functions/inverse_cdf/lognormal_icdf.stan renamed to functions/quantile_function/lognormal_qf.stan

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/** @ingroup icdf
2-
* **Lognormal Inverse CDF**
1+
/** @ingroup qf
2+
* **Lognormal Quantile Function**
33
*
44
* \f{aligned}{
55
* F^{-1}(p) &= \exp(\mu + \sqrt{2} \, \sigma \, \text{inv_erf}(2p - 1)) \\
@@ -20,7 +20,7 @@
2020
* @return inverse CDF value
2121
* @throws reject if \f$ p \notin [0, 1] \f$
2222
*/
23-
real lognormal_icdf (real p, real mu, real sigma){
23+
real lognormal_qf (real p, real mu, real sigma){
2424
if (is_nan(p) || p < 0 || p > 1)
2525
reject("lognormal_icdf: p must be between 0 and 1; ",
2626
"found p = ", p);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** \defgroup qf Quantile Functions also known as Inverse Cumulative Distribution Functions
2+
*
3+
* In probability and statistics, the quantile function - also known as
4+
* an inverse cumulative distribution function - is, associated with a probability distribution of a random variable, specifies
5+
* the value of the random variable such that the probability of the variable being less than or equal
6+
* to that value equals the given probability.
7+
*
8+
* See https://en.wikipedia.org/wiki/Quantile_function for more information.
9+
**/

functions/inverse_cdf/skewed_generalized_t_icdf.stan renamed to functions/quantile_function/skewed_generalized_t_qf.stan

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include special/inc_beta_inverse.stan
22

3-
/** @ingroup icdf
4-
* Skewed generalized T inverse CDF
3+
/** @ingroup qf
4+
* Skewed Generalized T Quantile Function
55
*
66
*
77
* For more information, please see @ref skew_generalized_t.
@@ -16,7 +16,7 @@
1616
* @param q Real \f$\in (0, \infty)\f$ kurtosis parameter
1717
* @return log probability
1818
*/
19-
real skewed_generalized_t_icdf (real p, real mu, real sigma, real lambda, real p, real q) {
19+
real skewed_generalized_t_qf (real p, real mu, real sigma, real lambda, real p, real q) {
2020
real z1 = beta(1.0 / p, q);
2121
real z2 = beta(2.0 / p, q - 1.0 / p);
2222
real v = sigma * q^(-1.0/p) * inv_sqrt( ( 3 * square(lambda) + 1 ) * beta(3.0/p, q - 2.0/p) / z1 - 4 * square(lambda * z2 / z1) );

functions/inverse_cdf/unit_johnson_su_icdf.stan renamed to functions/quantile_function/unit_johnson_su_qf.stan

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/** @ingroup icdf
2-
* Unit Johnson SU Inverse CDF
1+
/** @ingroup qf
2+
* Unit Johnson SU Quantile Function
33
*
44
* \f{aligned}{
55
* F^{-1}(p, \, \mu, \, \sigma) &= \text{inv_logit}\bigg[ \sinh\bigg(\frac{\Phi^{-1}(p) - \mu}{\sigma}\bigg) \bigg]\\
@@ -12,7 +12,7 @@
1212
* @return inverse CDF value
1313
* @throws reject if \f$ p \notin [0, 1] \f$
1414
*/
15-
real unit_johnson_icdf (real p, real mu, real sigma){
15+
real unit_johnson_qf (real p, real mu, real sigma){
1616
if (is_nan(p) || p < 0 || p > 1)
1717
reject("unit_johnson_icdf: p must be between 0 and 1; ",
1818
"found p = ", p);

0 commit comments

Comments
 (0)