Type: | Package |
Title: | Quotient of Random Variables Conditioned to the Positive Quadrant |
Version: | 1.2.1 |
Maintainer: | Yuancheng Si <siyuanchengman@gmail.com> |
Description: | Computes the exact probability density function of X/Y conditioned on positive quadrant for series of bivariate distributions,for more details see Nadarajah,Song and Si (2019) <doi:10.1080/03610926.2019.1576893>. |
Depends: | R (≥ 3.5.0) |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
Imports: | mvtnorm, stats |
NeedsCompilation: | no |
RoxygenNote: | 7.1.1 |
Packaged: | 2022-05-02 07:34:08 UTC; siyua |
Author: | Yuancheng Si |
Repository: | CRAN |
Date/Publication: | 2022-05-02 09:30:07 UTC |
Lemma
Description
Technical Lemmas for calculating quotient of random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper section 2.2.
Usage
I_1(a, b)
I_2(a, b)
I_3(a, b)
J_1(a, b, c, alpha)
J_2(a, b, c, alpha)
J_3(a, b, c, alpha)
Arguments
a |
parameter |
b |
parameter |
c |
parameter |
alpha |
parameter |
Details
I_n
Type I Integration
I_n (a, b) = \int_0^\infty y^n \exp \left( -a y^2 - b y \right) dy
For -\infty < a < \infty,-\infty < b < \infty
,where n is positive integer.
In particular,for a > 0
,we have expressions below
I_1 (a, b) = -\frac {\sqrt{\pi} b}{4 a^{3 / 2}}\exp \left( \frac {b^2}{4 a} \right)\ {\rm erfc} \left( \frac {b}{2 \sqrt{a}} \right) + \frac {1}{2 a}
I_2 (a, b) = \frac {\sqrt{\pi}}{4 a^{3 / 2}}\exp \left( \frac {b^2}{4 a} \right)\ {\rm erfc} \left( \frac {b}{2 \sqrt{a}} \right) +\frac {\sqrt{\pi} b^2}{8 a^{5 / 2}} \exp \left( \frac {b^2}{4 a} \right)\ {\rm erfc} \left( \frac {b}{2 \sqrt{a}} \right) - \frac {b}{4 a^2}
I_3 (a, b) = -\frac {3 \sqrt{\pi} b}{8 a^{5 / 2}}\exp \left( \frac {b^2}{4 a} \right)\ {\rm erfc} \left( \frac {b}{2 \sqrt{a}} \right) -\frac {\sqrt{\pi} b^3}{16 a^{7 / 2}}\exp \left( \frac {b^2}{4 a} \right)\ {\rm erfc} \left( \frac {b}{2 \sqrt{a}} \right) + \frac {1}{2 a^2} + \frac {b^2}{8 a^3}
J_n
Type J Integration
J_n (a, b, c, \alpha) = \int_0^\infty y^n \left( a y^2 + b y + c \right)^{-\alpha} dy
In particular,for a > 0,b^2 < 4ac, -1 < n < 2\alpha - 1
,we have expressions below
J_1 (a, b, c, \alpha) = a^{-1} c^{1 - \alpha} B \left( 2, 2 \alpha - 2 \right) \ {}_2F_1 \left( 1, \alpha - 1; \alpha + \frac {1}{2}; 1 - \frac {b^2}{4 a c} \right)
J_2 (a, b, c, \alpha) = a^{-\frac {3}{2}} c^{\frac {3}{2} - \alpha} B \left( 3, 2 \alpha - 3 \right) \ {}_2F_1 \left( \frac {3}{2}, \alpha - \frac {3}{2}; \alpha + \frac {1}{2}; 1 - \frac {b^2}{4 a c} \right)
J_3 (a, b, c, \alpha) = a^{-2} c^{2 - \alpha} B \left( 4, 2 \alpha - 4 \right) \ {}_2F_1 \left( 2, \alpha - 2; \alpha + \frac {1}{2}; 1 - \frac {b^2}{4 a c} \right)
Value
I_1
gives value of Type I integration with n = 1
I_2
gives value of Type I integration with n = 2
I_3
gives value of Type I integration with n = 3
J_1
gives value of Type J integration with n = 1
J_2
gives value of Type J integration with n = 2
J_3
gives value of Type J integration with n = 3
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishna, N. and Shiji, K. (2014). On a class of bivariate exponential distributions.Statistics and Probability Letters, 85, pp153-160.
Arnold, B. C. and Strauss, D. (1988).Pseudolikelihood estimation.Sankhya B , 53, pp233-243.
Caginalp, C. and Caginalp, G. (2018).The quotient of normal random variables and application to asset price fat tails.Physica A—Statistical Mechanics and Its Applications, 499, pp457-471.
Louzada, F., Ara, A. and Fernandes, G. (2017).The bivariate alpha-skew-normal distribution.Communications in Statistics - Theory and Methods, 46, pp7147-7156.
Nadarajah, S. (2009).A bivariate Pareto model for drought.Stochastic Environmental Research and Risk Assessment, 23, pp811-822.
Nadarajah, S. and Kotz, S. (2006).Reliability models based on bivariate exponential distributions.Probabilistic Engineering Mechanics, 21, pp338-351.
Nadarajah, S. and Kotz, S. (2007).Financial Pareto ratios.Quantitative Finance, 7, pp257-260.
Examples
I_1(1,2)
I_2(1,2)
I_3(1,2)
J_1(1,2,3,3)
J_2(1,2,3,3)
J_3(1,2,3,3)
BiMG_expPR
Description
probability density function of quotient of Morgenstern type bivariate exponential random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBiMG_expPR(x, a, b, alpha)
Arguments
x |
vector of positive quantiles. |
a |
parameter for Morgenstern type bivariate exponential distribution |
b |
parameter for Morgenstern type bivariate exponential distribution |
alpha |
parameter for Morgenstern type bivariate exponential distribution |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) = \frac {(1 + \alpha) \exp (a + b)}{\Pr (X > 0, Y > 0) (1 + r)^2} - \frac {2 \alpha \exp (a + 2 b)}{\Pr (X > 0, Y > 0) (2 + r)^2} - \frac {2 \alpha \exp (2 a + b)}{\Pr (X > 0, Y > 0) (1 + 2 r)^2} + \frac {\alpha \exp (2 a + 2 b)}{\Pr (X > 0, Y > 0) (1 + r)^2}
For r > 0
,-1 \leq \alpha \leq 1, a > -\infty, b > -\infty
These correlated exponential random variables can also be used to model the stress and strength components of a system, hence the quotient distribution can be used to estimate the probability of failure of the system
Value
dBiMG_expPR
gives the probability density function for quotient of Morgenstern type bivariate exponential random variables conditioned to the positive quadrant
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishnan, N. and Lai, C. -D. (2009).Continuous Bivariate Distributions.Springer Verlag, New York.
Balakrishna, N. and Shiji, K. (2014).On a class of bivariate exponential distributions.Statistics and Probability Letters, 85, pp153-160.
Examples
x <- seq(0.1,5,0.1)
y <- dBiMG_expPR(x, 3, 2, 0.5)
plot(x,y,type = 'l')
Bibs_expPR
Description
probability density function of quotient of Balakrishna and Shiji's bivariate exponential random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBibs_expPR(x, a, r)
Arguments
x |
vector of positive quantiles. |
a |
parameter for Balakrishna and Shiji's bivariate exponential distribution |
r |
parameter for Balakrishna and Shiji's bivariate exponential distribution |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) = \frac {a}{2 \sqrt{r}} \left( r + \frac {a^2}{4 r} \right)^{-3 / 2}
For r > 0
,a > 0
Value
dBibs_expPR
gives the probability density function for quotient of Balakrishna and Shiji's bivariate exponential random variables conditioned to the positive quadrant.
Invalid arguments will return an error message.
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishnan, N. and Lai, C. -D. (2009).Continuous Bivariate Distributions.Springer Verlag, New York.
Balakrishna, N. and Shiji, K. (2014).On a class of bivariate exponential distributions.Statistics and Probability Letters, 85, pp153-160.
Examples
x <- seq(0.1,5,0.1)
y <- dBibs_expPR(x, 2, 2)
plot(x,y,type = 'l')
BicauchyPR
Description
probability density function of quotient of Bivariate cauchy random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBicauchyPR(x, a, b)
Arguments
x |
single real positive scalar |
a |
parameter for bivaraite cauchy distribution |
b |
parameter for bivaraite cauchy distribution |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) =\frac {1}{2 \pi \Pr (X > 0, Y > 0)}J_1 \left( r^2 + 1, A r + B, C, \frac {3}{2} \right)
For -\infty < x < \infty
,-\infty < y < \infty,r > 0,-\infty < a < \infty,-\infty < b < \infty
,where A = -2 a, B = -2 b,C = 1 + a^2 + b^2
and J_1
is given by first reference paper section (2.5).
Value
dBicauchyPR
gives the probability density function for quotient of Bivariate cauchy random variables conditioned to the positive quadrant.
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishnan, N. and Lai, C. -D. (2009).Continuous Bivariate Distributions.Springer Verlag, New York.
Caginalp, C. and Caginalp, G. (2018).The quotient of normal random variables and application to asset price fat tails.Physica A—Statistical Mechanics and Its Applications, 499, pp457-471.
Louzada, F., Ara, A. and Fernandes, G. (2017).The bivariate alpha-skew-normal distribution.Communications in Statistics - Theory and Methods, 46, pp7147-7156.
Nadarajah, S. (2009).A bivariate Pareto model for drought.Stochastic Environmental Research and Risk Assessment, 23, pp811-822.
Nadarajah, S. and Kotz, S. (2006).Reliability models based on bivariate exponential distributions.Probabilistic Engineering Mechanics, 21, pp338-351.
Nadarajah, S. and Kotz, S. (2007).Financial Pareto ratios.Quantitative Finance, 7, pp257-260.
Examples
x <- seq(0.1,5,0.1)
y <- c()
for (i in x){y=c(y,dBicauchyPR(i,1,2))}
plot(x,y,type = 'l')
BiexpweightedPR
Description
probability density function of quotient of Bivariate exponential random variables resulting from weighted linear combinations conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBiexpweightedPR(x, a, b, c)
Arguments
x |
vector of positive quantiles. |
a |
parameter for Bivariate exponential random variables resulting from weighted linear combinations |
b |
parameter for Bivariate exponential random variables resulting from weighted linear combinations |
c |
parameter for Bivariate exponential random variables resulting from weighted linear combinations |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) = \frac {(1 - 2 c) \exp \left[ (1 - 2 c) a + b \right]} {\Pr (X > 0, Y > 0) \left[ 1 + (1 - 2 c) r \right]^2}
For x > a > -\infty
,y > b > -\infty,r > 0,0 < c < 1
,These correlated exponential random variables can be used to model the stress and strength components of a system, hence the quotient distribution can be used to estimate the probability of failure of the system
Value
dBiexpweightedPR
gives the probability density function for quotient of Bivariate exponential random variables resulting from weighted linear combinations conditioned to the positive quadrant.
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishnan, N. and Lai, C. -D. (2009).Continuous Bivariate Distributions.Springer Verlag, New York.
Caginalp, C. and Caginalp, G. (2018).The quotient of normal random variables and application to asset price fat tails.Physica A—Statistical Mechanics and Its Applications, 499, pp457-471.
Louzada, F., Ara, A. and Fernandes, G. (2017).The bivariate alpha-skew-normal distribution.Communications in Statistics - Theory and Methods, 46, pp7147-7156.
Nadarajah, S. (2009).A bivariate Pareto model for drought.Stochastic Environmental Research and Risk Assessment, 23, pp811-822.
Nadarajah, S. and Kotz, S. (2006).Reliability models based on bivariate exponential distributions.Probabilistic Engineering Mechanics, 21, pp338-351.
Nadarajah, S. and Kotz, S. (2007).Financial Pareto ratios.Quantitative Finance, 7, pp257-260.
Examples
x <- seq(0.1,5,0.1)
y <- dBiexpweightedPR(x, 4, 2, 0.2)
plot(x,y,type = 'l')
BilomaxPR
Description
probability density function of quotient of Bivariate Lomax random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBilomaxPR(x, a, b, c, alpha, beta, theta)
Arguments
x |
single positive scalar for quotient |
a |
parameter for Bivariate lomax distribution |
b |
parameter for Bivariate lomax distribution |
c |
parameter for Bivariate lomax distribution |
alpha |
parameter for Bivariate lomax distribution |
beta |
parameter for Bivariate lomax distribution |
theta |
parameter for Bivariate lomax distribution |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) = \frac {c^2 \theta^2 r}{\Pr (X > 0, Y > 0)} J_3 \left( \theta r, \beta - \theta a + \left( \alpha - \theta b \right) r, 1 - \alpha a - \beta b + \theta a b, c + 2 \right) +\frac {c^2 \theta \left[ (\alpha - \theta b) r + \beta - \theta a \right]} {\Pr (X > 0, Y > 0)} J_2 \left( \theta r, \beta - \theta a + \left( \alpha - \theta b \right) r, 1 - \alpha a - \beta b + \theta a b, c + 2 \right) +\frac {c \left[ c (\alpha - \theta b) (\beta - \theta a) + \alpha \beta - \theta \right]}{\Pr (X > 0, Y > 0)}J_1 \left( \theta r, \beta - \theta a + \left( \alpha - \theta b \right) r,1 - \alpha a - \beta b + \theta a b, c + 2 \right)
For r > 0
,\alpha > 0
, \beta > 0
, \theta > 0
, 0 \leq \theta \leq (c + 1) \alpha \beta
where J_1,J_2,J_3
are given by first reference paper section (2.5)
Value
dBilomaxPR
gives the probability density function for bivariate lomax random variables conditioned to the positive quadrant.
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishnan, N. and Lai, C. -D. (2009).Continuous Bivariate Distributions.Springer Verlag, New York.
BinormalPR
Description
probability density function of quotient of Bivariate normal random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBinormalPR(x, a, b, rho)
Arguments
x |
vector of positive quantiles. |
a |
parameter |
b |
parameter |
rho |
correlation coefficient, |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) =\frac {1}{2 \pi \sqrt{1 - \rho^2} \Pr (X > 0, Y > 0)}\exp \left[ -\frac {a^2 + b^2 - 2 \rho a b}{2 \left( 1 - \rho^2 \right)} \right]I_1 \left( \frac {1 + C r + r^2}{2 \left( 1 - \rho^2 \right)},\frac {A r + B}{2 \left( 1 - \rho^2 \right)} \right)
For -\infty < x < \infty
,-\infty < y < \infty,r > 0,-\infty < a < \infty,-\infty < b < \infty,-1 < \rho < 1
,where A = -2 a + 2 \rho b,B = -2 b + 2 \rho a,C = -2 \rho
Value
dBinormalPR
gives the probability density function for quotient of Bivariate normal random variables conditioned to the positive quadrant.
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishna, N. and Shiji, K. (2014). On a class of bivariate exponential distributions.Statistics and Probability Letters, 85, pp153-160.
Arnold, B. C. and Strauss, D. (1988).Pseudolikelihood estimation.Sankhya B , 53, pp233-243.
Caginalp, C. and Caginalp, G. (2018).The quotient of normal random variables and application to asset price fat tails.Physica A—Statistical Mechanics and Its Applications, 499, pp457-471.
Louzada, F., Ara, A. and Fernandes, G. (2017).The bivariate alpha-skew-normal distribution.Communications in Statistics - Theory and Methods, 46, pp7147-7156.
Nadarajah, S. (2009).A bivariate Pareto model for drought.Stochastic Environmental Research and Risk Assessment, 23, pp811-822.
Nadarajah, S. and Kotz, S. (2006).Reliability models based on bivariate exponential distributions.Probabilistic Engineering Mechanics, 21, pp338-351.
Nadarajah, S. and Kotz, S. (2007).Financial Pareto ratios.Quantitative Finance, 7, pp257-260.
Examples
x <- seq(0.1,5,0.1)
y <- dBinormalPR(x, 2, 1, 0.5)
plot(x,y,type = 'l')
BiparetoPR
Description
probability density function of quotient of Bivariate Pareto random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBiparetoPR(x)
Arguments
x |
vector of positive quantiles. |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) = (r + 1)^{-2}
For r > 0
,Nadarajah (2009) used this distribution to model the proportion of droughts defined as a quotient of drought durations and non-drought durations.
Value
dBiparetoPR
gives the probability density function for quotient of Bivariate Pareto random variables conditioned to the positive quadrant.
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Mardia, K. V. (1962).Multivariate Pareto distributions.Annals of Mathematical Statistics, 33, 1008-1015.
Nadarajah, S. (2009) A bivariate Pareto model for drought.Stochastic Environmental Research and Risk Assessment, 23, pp811-822.
Examples
x <- seq(0.1,5,0.1)
y <- dBiparetoPR(x)
plot(x,y,type = 'l')
BitPR
Description
probability density function of quotient of Bivariate t random variables conditioned to the positive quadrant.For more detailed information please read the first reference paper.
Usage
dBitPR(x, a, b, rho, v)
Arguments
x |
single positive scalar,for quotient of Bivariate t random variables conditioned to the positive quadrant |
a |
parameter for Bivariate t distribution |
b |
parameter for Bivariate t distribution |
rho |
correlation coefficient, |
v |
parameter, degree of freedom of Bivariate t distribution |
Details
Probability density function
f_R (r \mid X > 0, Y > 0) =\frac {\Gamma \left( \frac {\nu + 2}{2} \right) \nu^{\frac {\nu}{2}}\left( 1 - \rho^2 \right)^{\frac {\nu + 1}{2}}}{\Gamma \left( \frac {\nu}{2} \right) \pi \Pr (X > 0, Y > 0)}J_1 \left( r^2 - 2 \rho r + 1, A r + B, C + \nu \left( 1 - \rho^2 \right),\frac {\nu}{2} + 1 \right)
For -\infty < x < \infty
,-\infty < y < \infty,r > 0,-\infty < a < \infty,-\infty < b < \infty,-1 < \rho < 1
,where A = -2 a + 2 \rho b,B = -2 b + 2 \rho a,C = a^2 + b^2 - 2 \rho a b
and J_1
is given by first reference paper section (2.5).
Value
dBitPR
gives the probability density function for quotient of Bivariate t random variables conditioned to the positive quadrant.
Invalid arguments will return an error message.
Author(s)
Saralees Nadarajah & Yuancheng Si siyuanchengman@gmail.com
References
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Balakrishnan, N. and Lai, C. -D. (2009).Continuous Bivariate Distributions.Springer Verlag, New York.
Arnold, B. C. and Strauss, D. (1988).Pseudolikelihood estimation.Sankhya B , 53, pp233-243.
Caginalp, C. and Caginalp, G. (2018).The quotient of normal random variables and application to asset price fat tails.Physica A—Statistical Mechanics and Its Applications, 499, pp457-471.
Louzada, F., Ara, A. and Fernandes, G. (2017).The bivariate alpha-skew-normal distribution.Communications in Statistics - Theory and Methods, 46, pp7147-7156.
Nadarajah, S. (2009).A bivariate Pareto model for drought.Stochastic Environmental Research and Risk Assessment, 23, pp811-822.
Nadarajah, S. and Kotz, S. (2006).Reliability models based on bivariate exponential distributions.Probabilistic Engineering Mechanics, 21, pp338-351.
Nadarajah, S. and Kotz, S. (2007).Financial Pareto ratios.Quantitative Finance, 7, pp257-260.
Examples
x <- seq(0.1,5,0.1)
y <- c()
for (i in x){y=c(y,dBitPR(i,1,2,0.5,2))}
plot(x,y,type = 'l')
f21hyper
Description
Computes the value of a Gaussian hypergeometric function F(a,b,c,z)
for -1 \leq z \leq 1
and a,b,c \geq 0
Usage
f21hyper(a, b, c, z)
Arguments
a |
The parameter |
b |
The parameter |
c |
The parameter |
z |
The parameter |
Details
The function f21hyper
complements the analysis of the 'hyper-g prior' introduced by Liang et al. (2008).
For parameter values, compare cf. https://en.wikipedia.org/wiki/Hypergeometric_function#The_series_2F1.
Value
Invalid arguments will return an error message.
Author(s)
Martin Feldkircher and Stefan Zeugner
References
Liang F., Paulo R., Molina G., Clyde M., Berger J.(2008): Mixtures of g-priors for Bayesian variable selection. J. Am. Statist. Assoc. 103, p. 410-423
Yuancheng Si and Saralees Nadarajah and Xiaodong Song, (2020). On the distribution of quotient of random variables conditioned to the positive quadrant. Communications in Statistics - Theory and Methods, 49, pp2514-2528.
Saralees Nadarajah and Y.Si (2020) A note on the “L-logistic regression models: Prior sensitivity analysis, robustness to outliers and applications”. Brazilian Journal of Probability and Statistics,34,p. 183-187.
Examples
f21hyper(30,1,20,.8) #returns about 165.8197
f21hyper(30,10,20,0) #returns one
f21hyper(10,15,20,-0.1) # returns about 0.4872972