Type: | Package |
Title: | Computes Value at Risk and Expected Shortfall for over 100 Parametric Distributions |
Version: | 1.0.2 |
Date: | 2023-04-20 |
Depends: | R (≥ 2.15.0) |
Description: | Computes Value at risk and expected shortfall, two most popular measures of financial risk, for over one hundred parametric distributions, including all commonly known distributions. Also computed are the corresponding probability density function and cumulative distribution function. See Chan, Nadarajah and Afuecheta (2015) <doi:10.1080/03610918.2014.944658> for more details. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
NeedsCompilation: | no |
BugReports: | https://github.com/lbelzile/VaRES/issues/ |
Packaged: | 2023-04-21 16:03:39 UTC; lbelzile |
Author: | Leo Belzile |
Maintainer: | Leo Belzile <belzilel@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-04-22 00:42:37 UTC |
Computes value at risk and expected shortfall for over 100 parametric distributions
Description
Computes Value at risk and expected shortfall, two most popular measures of financial risk, for over one hundred parametric distributions, including all commonly known distributions. Also computed are the corresponding probability density function and cumulative distribution function.
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Birnbaum-Saunders distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Birnbaum-Saunders distribution due to Birnbaum and Saunders (1969a, 1969b) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {x^{1/2} + x^{-1/2}}{2 \gamma x}
\phi \left( \frac {x^{1/2} - x^{-1/2}}{\gamma} \right),
\\
&\displaystyle
F (x) = \Phi \left( \frac {x^{1/2} - x^{-1/2}}{\gamma} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{4} \left\{ \gamma \Phi^{-1} (p) + \sqrt{4 + \gamma^2 \left[ \Phi^{-1} (p) \right]^2} \right\}^2,
\\
&\displaystyle
{\rm ES}_p (X) =
\frac {1}{4 p} \int_0^p \left\{ \gamma \Phi^{-1} (v) + \sqrt{4 + \gamma^2 \left[ \Phi^{-1} (v) \right]^2} \right\}^2 dv
\end{array}
for x > 0
, 0 < p < 1
, and \gamma > 0
, the scale parameter.
Usage
dBS(x, gamma=1, log=FALSE)
pBS(x, gamma=1, log.p=FALSE, lower.tail=TRUE)
varBS(p, gamma=1, log.p=FALSE, lower.tail=TRUE)
esBS(p, gamma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
gamma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dBS(x)
pBS(x)
varBS(x)
esBS(x)
Cauchy distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Cauchy distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\pi} \frac {\sigma}{(x - \mu)^2 + \sigma^2},
\\
&\displaystyle
F (x) = \frac {1}{2} + \frac {1}{\pi} \arctan \left( \frac {x - \mu}{\sigma} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \mu + \sigma \tan \left( \pi \left( p - \frac {1}{2} \right) \right),
\\
&\displaystyle
{\rm ES}_p (X) = \mu + \frac {\sigma}{p} \int_0^p \tan \left( \pi \left( v - \frac {1}{2} \right) \right) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and
\sigma > 0
, the scale parameter.
Usage
dCauchy(x, mu=0, sigma=1, log=FALSE)
pCauchy(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varCauchy(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esCauchy(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dCauchy(x)
pCauchy(x)
varCauchy(x)
esCauchy(x)
F distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the F distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{B \left( \frac {d_1}{2}, \frac {d_2}{2} \right)}
\left( \frac {d_1}{d_2} \right)^{\frac {d_1}{2}}
x^{\frac {d_1}{2} - 1}
\left( 1 + \frac {d_1}{d_2} x \right)^{-\frac {d_1 + d_2}{2}},
\\
&\displaystyle
F (x) = I_{\frac {d_1 x}{d_1 x + d_2}} \left( \frac {d_1}{2}, \frac {d_2}{2} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {d_2}{d_1} \frac {I_p^{-1} \left( \frac {d_1}{2}, \frac {d_2}{2} \right)}
{1 - I_p^{-1} \left( \frac {d_1}{2}, \frac {d_2}{2} \right)},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {d_2}{d_1 p} \int_0^p
\frac {I_v^{-1} \left( \frac {d_1}{2}, \frac {d_2}{2} \right)}
{1 - I_v^{-1} \left( \frac {d_1}{2}, \frac {d_2}{2} \right)} dv
\end{array}
for x \geq K
, 0 < p < 1
, d_1 > 0
, the first degree of freedom parameter,
and d_2 > 0
, the second degree of freedom parameter.
Usage
dF(x, d1=1, d2=1, log=FALSE)
pF(x, d1=1, d2=1, log.p=FALSE, lower.tail=TRUE)
varF(p, d1=1, d2=1, log.p=FALSE, lower.tail=TRUE)
esF(p, d1=1, d2=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
d1 |
the value of the first degree of freedom parameter, must be positive, the default is 1 |
d2 |
the value of the second degree of freedom parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dF(x)
pF(x)
varF(x)
esF(x)
Freimer distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Freimer distribution due to Freimer et al. (1988) given by
\begin{array}{ll}
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{a} \left[ \frac {p^b - 1}{b} -
\frac {(1 - p)^c - 1}{c} \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{a} \left( \frac {1}{c} - \frac {1}{b} \right) +
\frac {p^b}{a b (b + 1)} + \frac {(1 - p)^{c + 1} - 1}{p a c (c + 1)}
\end{array}
for 0 < p < 1
, a > 0
, the scale parameter,
b > 0
, the first shape parameter, and c > 0
, the second shape parameter.
Usage
varFR(p, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
esFR(p, a=1, b=1, c=1)
Arguments
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
varFR(x)
esFR(x)
Gamma distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the gamma distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {b^a x^{a - 1} \exp (-b x)}{\Gamma (a)},
\\
&\displaystyle
F (x) = \frac {\gamma (a, b x)}{\Gamma (a)},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{b} Q^{-1} (a, 1 - p),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{b p} \int_0^p Q^{-1} (a, 1 - v) dv
\end{array}
for x > 0
, 0 < p < 1
, b > 0
, the scale parameter, and a > 0
, the shape parameter,
where \gamma (a, x) = \int_0^x t^{a - 1} \exp \left( -t \right) dt
denotes the incomplete gamma function,
Q (a, x) = \int_x^\infty t^{a - 1} \exp \left( -t \right) dt / \Gamma (a)
denotes the regularized complementary incomplete gamma function,
\Gamma (a) = \int_0^\infty t^{a - 1} \exp \left( -t \right) dt
denotes the gamma function,
and Q^{-1} (a, x)
denotes the inverse of Q (a, x)
.
Usage
dGamma(x, a=1, b=1, log=FALSE)
pGamma(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varGamma(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esGamma(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dGamma(x)
pGamma(x)
varGamma(x)
esGamma(x)
Holla-Bhattacharya Laplace distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Holla-Bhattacharya Laplace distribution due to Holla and Bhattacharya (1968) given by
\begin{array}{ll}
&
f (x) = \left\{ \begin{array}{ll}
\displaystyle
a \phi \exp \left\{ \phi \left( x - \theta \right) \right\}, & \mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
\left( 1 - a \right) \phi \exp \left\{ \phi \left( \theta - x \right) \right\}, & \mbox{if $x > \theta$,}
\end{array}
\right.
\\
&
F (x) = \left\{
\begin{array}{ll}
\displaystyle
a \exp \left( \phi x - \theta \phi \right), & \mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
1 - (1 - a) \exp \left( \theta \phi - \phi x \right), & \mbox{if $x > \theta$,}
\end{array}
\right.
\\
&
{\rm VaR}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\theta + \frac {1}{\phi} \log \left( \frac {p}{a} \right), &
\mbox{if $p \leq a$,}
\\
\\
\displaystyle
\theta - \frac {1}{\phi} \log \left( \frac {1 - p}{1 - a} \right), &
\mbox{if $p > a$,}
\end{array}
\right.
\\
&
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\theta - \frac {1}{\phi} + \frac {1}{\phi} \log \frac {p}{a}, & \mbox{if $p \leq a$,}
\\
\\
\displaystyle
\frac {1}{p} \left[ \theta (1 + p - a) + \frac {p - 2a - (1 - a) \log a}{\phi} +
\frac {1 - p}{\phi} \log \frac {1 - p}{1 - a} \right], & \mbox{if $p > a$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \theta < \infty
, the location parameter,
0 < a < 1
, the first scale parameter, and \phi > 0
, the second scale parameter.
Usage
dHBlaplace(x, a=0.5, theta=0, phi=1, log=FALSE)
pHBlaplace(x, a=0.5, theta=0, phi=1, log.p=FALSE, lower.tail=TRUE)
varHBlaplace(p, a=0.5, theta=0, phi=1, log.p=FALSE, lower.tail=TRUE)
esHBlaplace(p, a=0.5, theta=0, phi=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, can take any real value, the default is zero |
a |
the value of the first scale parameter, must be in the unit interval, the default is 0.5 |
phi |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dHBlaplace(x)
pHBlaplace(x)
varHBlaplace(x)
esHBlaplace(x)
Hankin-Lee distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Hankin-Lee distribution due to Hankin and Lee (2006) given by
\begin{array}{ll}
&\displaystyle
{\rm VaR}_p (X) = \frac {c p^a}{(1 - p)^b},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {c}{p} B_p (a + 1, 1 - b)
\end{array}
for 0 < p < 1
, c > 0
, the scale parameter, a > 0
, the first shape parameter,
and b > 0
, the second shape parameter.
Usage
varHL(p, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
esHL(p, a=1, b=1, c=1)
Arguments
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
c |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
varHL(x)
esHL(x)
Hosking logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Hosking logistic distribution due to Hosking (1989, 1990) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {(1 - k x)^{1 / k - 1}}{\left[ 1 + (1 - k x)^{1 / k} \right]^2},
\\
&\displaystyle
F (x) = \frac {1}{1 + (1 - k x)^{1 / k}},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{k} \left[ 1 - \left( \frac {1 - p}{p} \right)^k \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{k} - \frac {1}{kp} B_p (1 - k, 1 + k)
\end{array}
for x < 1/k
if k > 0
, x > 1/k
if k < 0
, -\infty < x < \infty
if k = 0
,
and -\infty < k < \infty
, the shape parameter.
Usage
dHlogis(x, k=1, log=FALSE)
pHlogis(x, k=1, log.p=FALSE, lower.tail=TRUE)
varHlogis(p, k=1, log.p=FALSE, lower.tail=TRUE)
esHlogis(p, k=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
k |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dHlogis(x)
pHlogis(x)
varHlogis(x)
esHlogis(x)
Libby-Novick beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Libby-Novick beta distribution due to Libby and Novick (1982) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\lambda^a x^{a - 1} (1 - x)^{b - 1}}
{B (a, b) \left[ 1 - (1 - \lambda) x \right]^{a + b}},
\\
&\displaystyle
F (x) = I_{\frac {\lambda x}{1 + (\lambda - 1) x}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {I_p^{-1} (a, b)}{\lambda - (\lambda - 1) I_p^{-1} (a, b)},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p
\frac {I_v^{-1} (a, b)}{\lambda - (\lambda - 1) I_v^{-1} (a, b)} dv
\end{array}
for 0 < x < 1
, 0 < p < 1
, \lambda > 0
, the scale parameter, a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dLNbeta(x, lambda=1, a=1, b=1, log=FALSE)
pLNbeta(x, lambda=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varLNbeta(p, lambda=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esLNbeta(p, lambda=1, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dLNbeta(x)
pLNbeta(x)
varLNbeta(x)
esLNbeta(x)
McDonald-Richards beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the McDonald-Richards beta distribution due to McDonald and Richards (1987a, 1987b) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {x^{ar - 1} \left( bq^r - x^r \right)^{b - 1}}
{\left( b q^r \right)^{a + b - 1} B (a, b)},
\\
&\displaystyle
F (x) = I_{\frac {x^r}{b q^r}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = b^{1/r} q \left[ I_p^{-1} (a, b) \right]^{1/r},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {b^{1/r} q}{p} \int_0^p \left[ I_v^{-1} (a, b) \right]^{1/r} dv
\end{array}
for 0 \leq x \leq b^{1 / r} q
, 0 < p < 1
, q > 0
, the scale parameter, a > 0
, the first shape parameter,
b > 0
, the second shape parameter, and r > 0
, the third shape parameter.
Usage
dMRbeta(x, a=1, b=1, r=1, q=1, log=FALSE)
pMRbeta(x, a=1, b=1, r=1, q=1, log.p=FALSE, lower.tail=TRUE)
varMRbeta(p, a=1, b=1, r=1, q=1, log.p=FALSE, lower.tail=TRUE)
esMRbeta(p, a=1, b=1, r=1, q=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
q |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
r |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dMRbeta(x)
pMRbeta(x)
varMRbeta(x)
esMRbeta(x)
McGill Laplace distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the McGill Laplace distribution due to McGill (1962) given by
\begin{array}{ll}
&\displaystyle
f (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2 \psi} \exp \left( \frac {x - \theta}{\psi} \right), & \mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
\frac {1}{2 \phi} \exp \left( \frac {\theta - x}{\phi} \right), & \mbox{if $x > \theta$,}
\end{array}
\right.
\\
&\displaystyle
F (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2} \exp \left( \frac {x - \theta}{\psi} \right), & \mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
1 - \frac {1}{2} \exp \left( \frac {\theta - x}{\phi} \right), & \mbox{if $x > \theta$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\theta + \psi \log (2 p), & \mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\theta - \phi \log \left( 2 (1 - p) \right), & \mbox{if $p > 1/2$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\psi + \theta \log (2 p) - \theta p, & \mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\theta + \phi + \frac {\psi - \phi - 2 \theta}{2 p} + \frac {\phi}{p} \log 2 - \phi \log 2
\\
\displaystyle
\quad
+\frac {\phi}{p} \log (1 - p) - \phi \log (1 - p), & \mbox{if $p > 1/2$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \theta < \infty
, the location parameter,
\phi > 0
, the first scale parameter, and \psi > 0
, the second scale parameter.
Usage
dMlaplace(x, theta=0, phi=1, psi=1, log=FALSE)
pMlaplace(x, theta=0, phi=1, psi=1, log.p=FALSE, lower.tail=TRUE)
varMlaplace(p, theta=0, phi=1, psi=1, log.p=FALSE, lower.tail=TRUE)
esMlaplace(p, theta=0, phi=1, psi=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, can take any real value, the default is zero |
phi |
the value of the first scale parameter, must be positive, the default is 1 |
psi |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dMlaplace(x)
pMlaplace(x)
varMlaplace(x)
esMlaplace(x)
Poiraud-Casanova-Thomas-Agnan Laplace distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Poiraud-Casanova-Thomas-Agnan Laplace distribution due to Poiraud-Casanova and Thomas-Agnan (2000) given by
\begin{array}{ll}
&\displaystyle
f (x) = \left\{
\begin{array}{ll}
\displaystyle
a \left( 1 - a \right) \exp \left\{ \left( 1 - a \right)
\left( x - \theta \right) \right\}, & \mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
a \left( 1 - a \right) \exp \left\{ a \left( \theta - x \right) \right\}, & \mbox{if $x > \theta$,}
\end{array}
\right.
\\
&\displaystyle
F (x) =
\left\{
\begin{array}{ll}
\displaystyle
a \exp \left\{ \left( 1 - a \right)
\left( x - \theta \right) \right\}, & \mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
1 - \left( 1 - a \right)
\exp \left\{ a \left( \theta - x \right) \right\}, & \mbox{if $x > \theta$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\theta + \frac {1}{1 - a} \log \left( \frac {p}{a} \right), & \mbox{if $p \leq a$,}
\\
\\
\displaystyle
\theta - \frac {1}{a} \log \left( \frac {1 - p}{1 - a} \right), & \mbox{if $p > a$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\theta - \frac {\log a}{1 - a} + \frac {\log p - 1}{(1 - a) p}, & \mbox{if $p \leq a$,}
\\
\\
\displaystyle
\theta - \frac {1}{a} + \frac {1}{p} - \frac {a}{(1 - a) p} + \frac {1 - p}{a p}
\log \left( \frac {1 - p}{1 - a} \right), & \mbox{if $p > a$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \theta < \infty
, the location parameter, and
a > 0
, the scale parameter.
Usage
dPCTAlaplace(x, a=0.5, theta=0, log=FALSE)
pPCTAlaplace(x, a=0.5, theta=0, log.p=FALSE, lower.tail=TRUE)
varPCTAlaplace(p, a=0.5, theta=0, log.p=FALSE, lower.tail=TRUE)
esPCTAlaplace(p, a=0.5, theta=0)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, can take any real value, the default is zero |
a |
the value of the scale parameter, must be in the unit interval, the default is 0.5 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dPCTAlaplace(x)
pPCTAlaplace(x)
varPCTAlaplace(x)
esPCTAlaplace(x)
Ramberg-Schmeiser distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Ramber-Schmeiser distribution due to Ramberg and Schmeiser (1974) given by
\begin{array}{ll}
&\displaystyle
{\rm VaR}_p (X) = \frac {p^b - (1 - p)^c}{d},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {p^{b}}{d (b + 1)} + \frac {(1 - p)^{c + 1} - 1}{p d (c + 1)}
\end{array}
for 0 < p < 1
, b > 0
, the first shape parameter,
c > 0
, the second shape parameter, and d > 0
, the scale parameter.
Usage
varRS(p, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
esRS(p, b=1, c=1, d=1)
Arguments
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
d |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
varRS(x)
esRS(x)
Student's t distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Student's t
distribution due to Gosset (1908) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\Gamma \left( \frac {n + 1}{2} \right)}{\sqrt{n \pi} \Gamma \left( \frac {n}{2} \right)}
\left( 1 + \frac {x^2}{n} \right)^{-\frac {n + 1}{2}},
\\
&\displaystyle
F (x) = \frac {1 + {\rm sign} (x)}{2} - \frac {{\rm sign} (x)}{2} I_{\frac {n}{x^2 + n}} \left( \frac {n}{2}, \frac {1}{2} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \sqrt{n} {\rm sign} \left( p - \frac {1}{2} \right)
\sqrt{\frac {1}{I_a^{-1} \left( \frac {n}{2}, \frac {1}{2} \right)} - 1},
\\
&\displaystyle
\quad
\mbox{ where $a = 2p$ if $p < 1/2$, $a = 2(1 - p)$ if $p \geq 1/2$,}
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sqrt{n}}{p} \int_0^p {\rm sign} \left( v - \frac {1}{2} \right)
\sqrt{\frac {1}{I_a^{-1} \left( \frac {n}{2}, \frac {1}{2} \right)} - 1} dv,
\\
&\displaystyle
\quad
\mbox{ where $a = 2v$ if $v < 1/2$, $a = 2(1 - v)$ if $v \geq 1/2$}
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, and n > 0
, the degree of freedom parameter.
Usage
dT(x, n=1, log=FALSE)
pT(x, n=1, log.p=FALSE, lower.tail=TRUE)
varT(p, n=1, log.p=FALSE, lower.tail=TRUE)
esT(p, n=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
n |
the value of the degree of freedom parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dT(x)
pT(x)
varT(x)
esT(x)
Tukey-Lambda distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Tukey-Lambda distribution due to Tukey (1962) given by
\begin{array}{ll}
&\displaystyle
{\rm VaR}_p (X) = \frac {p^\lambda - (1 - p)^\lambda}{\lambda},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {p^{\lambda + 1} + (1 - p)^{\lambda + 1} - 1}{p \lambda (\lambda + 1)}
\end{array}
for 0 < p < 1
, and \lambda > 0
, the shape parameter.
Usage
varTL(p, lambda=1, log.p=FALSE, lower.tail=TRUE)
esTL(p, lambda=1)
Arguments
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
varTL(x)
esTL(x)
Topp-Leone distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Topp-Leone distribution due to Topp and Leone (1955) given by
\begin{array}{ll}
&\displaystyle
f(x) = 2 b (x (2 - x))^{b - 1} (1 - x),
\\
&\displaystyle
F(x) = (x (2 - x))^b,
\\
&\displaystyle
{\rm VaR}_p (X) = 1 - \sqrt{1 - p^{1 / b}},
\\
&\displaystyle
{\rm ES}_p (X) = 1 - \frac {b}{p} B_{p^{1 / b}} \left( b, \frac {3}{2} \right)
\end{array}
for x > 0
, 0 < p < 1
, and b > 0
, the shape parameter.
Usage
dTL2(x, b=1, log=FALSE)
pTL2(x, b=1, log.p=FALSE, lower.tail=TRUE)
varTL2(p, b=1, log.p=FALSE, lower.tail=TRUE)
esTL2(p, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dTL2(x)
pTL2(x)
varTL2(x)
esTL2(x)
Asymmetric exponential power distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the asymmetric exponential power distribution due to Zhu and Zinde-Walsh (2009) given by
\begin{array}{ll}
&\displaystyle
f (x) = \left\{ \begin{array}{ll}
\displaystyle
\frac {\alpha}{\alpha^{*}} K \left( q_1 \right) \exp \left[ -\frac {1}{q_1} \left | \frac {x}{2 \alpha^{*}} \right |^{q_1} \right], & \mbox{if $x \leq 0$,}
\\
\\
\displaystyle
\frac {1 - \alpha}{1 - \alpha^{*}} K \left( q_2 \right) \exp \left[ -\frac {1}{q_2} \left | \frac {x}{2 - 2 \alpha^{*}} \right |^{q_2} \right], & \mbox{if $x > 0$,}
\end{array}
\right.
\\
&\displaystyle
F (x) = \left\{ \begin{array}{ll}
\displaystyle
\alpha Q \left( \frac {1}{q_1} \left( \frac {\mid x \mid}{2 \alpha^{*}} \right)^{q_1}, \frac {1}{q_1} \right), & \mbox{if $x \leq 0$,}
\\
\\
\displaystyle
1 - (1 - \alpha) Q \left( \frac {1}{q_2} \left( \frac {\mid x \mid}{2 - 2 \alpha^{*}} \right)^{q_2}, \frac {1}{q_2} \right), & \mbox{if $x > 0$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
-2 \alpha^{*} \left[ q_1 Q^{-1} \left( \frac {p}{\alpha}, \frac {1}{q_1} \right) \right]^{\frac {1}{q_1}}, & \mbox{if $p \leq \alpha$,}
\\
\\
\displaystyle
2 \left(1 - \alpha^{*}\right) \left[ q_2 Q^{-1} \left( \frac {1 - p}{1 - \alpha}, \frac {1}{q_2} \right) \right]^{\frac {1}{q_2}}, & \mbox{if $p > \alpha$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
-\frac {2 \alpha^{*}}{p} \int_0^p \left[ q_1 Q^{-1} \left( \frac {v}{\alpha}, \frac {1}{q_1} \right) \right]^{\frac {1}{q_1}} dv, & \mbox{if $p \leq \alpha$,}
\\
\\
\displaystyle
-\frac {2 \alpha^{*}}{p} \int_0^\alpha \left[ q_1 Q^{-1} \left( \frac {v}{\alpha}, \frac {1}{q_1} \right) \right]^{\frac {1}{q_1}} dv & \
\\
\quad
\displaystyle
+\frac {2 \left(1 - \alpha^{*}\right)}{p} \int_\alpha^p \left[ q_2 Q^{-1} \left( \frac {1 - v}{1 - \alpha}, \frac {1}{q_2} \right) \right]^{\frac {1}{q_2}} dv, & \mbox{if $p > \alpha$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, 0 < \alpha < 1
, the scale parameter, q_1 > 0
, the first shape parameter, and q_2 > 0
, the second shape parameter, where \alpha^{*} = \alpha K \left( q_1 \right) / \left\{ \alpha K \left( q_1 \right) + (1 - \alpha) K \left( q_2 \right) \right\}
, K (q) = \frac {1}{2 q^{1/q} \Gamma (1 + 1/q)}
, Q (a, x) = \int_x^\infty t^{a - 1} \exp \left( -t \right) dt / \Gamma (a)
denotes the regularized complementary incomplete gamma function, \Gamma (a) = \int_0^\infty t^{a - 1} \exp \left( -t \right) dt
denotes the gamma function, and Q^{-1} (a, x)
denotes the inverse of Q (a, x)
.
Usage
daep(x, q1=1, q2=1, alpha=0.5, log=FALSE)
paep(x, q1=1, q2=1, alpha=0.5, log.p=FALSE, lower.tail=TRUE)
varaep(p, q1=1, q2=1, alpha=0.5, log.p=FALSE, lower.tail=TRUE)
esaep(p, q1=1, q2=1, alpha=0.5)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
alpha |
the value of the scale parameter, must be in the unit interval, the default is 0.5 |
q1 |
the value of the first shape parameter, must be positive, the default is 1 |
q2 |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
daep(x)
paep(x)
varaep(x)
esaep(x)
Arcsine distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the arcsine distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\pi \sqrt{(x - a) (b - x)}},
\\
&\displaystyle
F (x) = \frac {2}{\pi} \arcsin \left( \sqrt{\frac {x - a}{b - a}} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = a + (b - a) \sin^2 \left( \frac {\pi p}{2} \right),
\\
&\displaystyle
{\rm ES}_p (X) = a + \frac {b - a}{p} \int_0^p \sin^2 \left( \frac {\pi v}{2} \right) dv
\end{array}
for a \leq x \leq b
, 0 < p < 1
, -\infty < a < \infty
, the first location parameter, and -\infty < a < b < \infty
, the second location parameter.
Usage
darcsine(x, a=0, b=1, log=FALSE)
parcsine(x, a=0, b=1, log.p=FALSE, lower.tail=TRUE)
vararcsine(p, a=0, b=1, log.p=FALSE, lower.tail=TRUE)
esarcsine(p, a=0, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first location parameter, can take any real value, the default is zero |
b |
the value of the second location parameter, can take any real value but must be greater than a, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
darcsine(x)
parcsine(x)
vararcsine(x)
esarcsine(x)
Generalized asymmetric Student's t distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized asymmetric Student's t
distribution due to Zhu and Galbraith (2010) given by
\begin{array}{ll}
&\displaystyle
\displaystyle
f (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {\alpha}{\alpha^{*}} K \left( \nu_1 \right) \left[ 1 + \frac {1}{\nu_1}
\left( \frac {x}{2 \alpha^{*}} \right)^2 \right]^{-\frac {\nu_1 + 1}{2}}, & \mbox{if $x \leq 0$,}
\\
\\
\displaystyle
\frac {1 - \alpha}{1 - \alpha^{*}} K \left( \nu_2 \right)
\left[ 1 + \frac {1}{\nu_2} \left( \frac {x}{2 \left( 1 - \alpha^{*} \right)} \right)^2 \right]^{-\frac {\nu_2 + 1}{2}}, &
\mbox{if $x > 0$,}
\end{array}
\right.
\\
&\displaystyle
\displaystyle
F (x) = 2 \alpha F_{\nu_1} \left( \frac {\min (x, 0)}{2 \alpha^{*}} \right) -1 + \alpha + 2 (1 - \alpha)
F_{\nu_2} \left( \frac {\max (x, 0)}{2 - 2 \alpha^{*}} \right),
\\
&\displaystyle
\displaystyle
{\rm VaR}_p (X) = 2 \alpha^{*} F_{\nu_1}^{-1} \left( \frac {\min (p, \alpha)}{2 \alpha} \right) +
2 \left( 1 - \alpha^{*} \right) F_{\nu_2}^{-1} \left( \frac {\max (p, \alpha) + 1 - 2 \alpha}{2 - 2 \alpha} \right),
\\
&\displaystyle
\displaystyle
{\rm ES}_p (X) = \frac {2 \alpha^{*}}{p} \int_0^p F_{\nu_1}^{-1}
\left( \frac {\min (v, \alpha)}{2 \alpha} \right) dv +
\frac {2 \left( 1 - \alpha^{*} \right)}{p} \int_0^p F_{\nu_2}^{-1}
\left( \frac {\max (v, \alpha) + 1 - 2 \alpha}{2 - 2 \alpha} \right) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, 0 < \alpha < 1
, the scale parameter, \nu_1 > 0
, the first degree of freedom parameter,
and \nu_2 > 0
, the second degree of freedom parameter, where \alpha^{*} = \alpha K \left( \nu_1 \right) / \left\{ \alpha K \left( \nu_1 \right) + (1 - \alpha) K \left( \nu_2 \right) \right\}
, K (\nu) = \Gamma \left( (\nu + 1)/2 \right) / \left[ \sqrt{\pi \nu} \Gamma (\nu/2) \right]
, F_\nu(\cdot)
denotes the cdf of a Student's t
random variable with \nu
degrees of freedom, and F_\nu^{-1} (\cdot)
denotes the inverse of F_\nu(\cdot)
.
Usage
dast(x, nu1=1, nu2=1, alpha=0.5, log=FALSE)
past(x, nu1=1, nu2=1, alpha=0.5, log.p=FALSE, lower.tail=TRUE)
varast(p, nu1=1, nu2=1, alpha=0.5, log.p=FALSE, lower.tail=TRUE)
esast(p, nu1=1, nu2=1, alpha=0.5)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
alpha |
the value of the scale parameter, must be in the unit interval, the default is 0.5 |
nu1 |
the value of the first degree of freedom parameter, must be positive, the default is 1 |
nu2 |
the value of the second degree of freedom parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dast(x)
past(x)
varast(x)
esast(x)
Asymmetric Laplace distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the asymmetric Laplace distribution due to Kotz et al. (2001) given by
\begin{array}{ll}
&\displaystyle
\displaystyle
f(x) = \left\{ \begin{array}{ll}
\displaystyle
\frac {\kappa \sqrt{2}}{\tau \left( 1 + \kappa^2 \right)}
\exp \left( -\frac {\kappa \sqrt{2}}{\tau} \left | x - \theta \right | \right), & \mbox{if $x \geq \theta$,}
\\
\\
\displaystyle
\frac {\kappa \sqrt{2}}{\tau \left( 1 + \kappa^2 \right)}
\exp \left( -\frac {\sqrt{2}}{\kappa \tau} \left | x - \theta \right | \right), & \mbox{if $x < \theta$,}
\end{array}
\right.
\\
&\displaystyle
F (x) = \left\{ \begin{array}{ll}
\displaystyle
1 - \frac {1}{1 + \kappa^2} \exp \left( \frac {\kappa \sqrt{2} (\theta - x)}{\tau} \right), &
\mbox{if $x \geq \theta$,}
\\
\\
\displaystyle
\frac {\kappa^2}{1 + \kappa^2} \exp \left( \frac {\sqrt{2} (x - \theta)}{\kappa \tau} \right), & \mbox{if $x < \theta$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
\theta - \frac {\tau}{\sqrt{2} \kappa}
\log \left[ (1 - p) \left( 1 + \kappa^2 \right) \right], & \mbox{if $p \geq \frac {\kappa^2}{1 + \kappa^2}$,}
\\
\\
\displaystyle
\theta + \frac {\kappa \tau}{\sqrt{2}} \log \left[ p \left( 1 + \kappa^{-2} \right) \right], &
\mbox{if $p < \frac {\kappa^2}{1 + \kappa^2}$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
\frac {\theta}{p} + \theta - \frac {\tau}{\sqrt{2} \kappa} \log \left( 1 + \kappa^2 \right) +
\frac {\sqrt{2} \tau \left( 1 + 2 \kappa^2 \right)}{2 \kappa \left( 1 + \kappa^2 \right) p}
\log \left( 1 + \kappa^2 \right)
\\
\displaystyle
\quad
-\frac {\sqrt{2} \tau \kappa \log \kappa}{\left( 1 + \kappa^2 \right) p} -
\frac {\theta \kappa^2}{\left( 1 + \kappa^2 \right) p} +
\frac {\tau \left( 1 - \kappa^4 \right)}{\sqrt{2} \kappa \left( 1 + \kappa^2 \right) p}
\\
\displaystyle
\quad
-\frac {\tau (1 - p)}{\sqrt{2} \kappa p} + \frac {\tau (1 - p)}{\sqrt{2} \kappa p} \log (1 - p), &
\mbox{if $p \geq \frac {\kappa^2}{1 + \kappa^2}$,}
\\
\\
\displaystyle
\theta + \frac {\kappa \tau}{\sqrt{2}}
\log \left( 1 + \kappa^{-2} \right) +
\frac {\kappa \tau}{\sqrt{2}} (\log p - 1), & \mbox{if $p < \frac {\kappa^2}{1 + \kappa^2}$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \theta < \infty
, the location parameter, \kappa > 0
, the first scale parameter, and \tau > 0
, the second scale parameter.
Usage
dasylaplace(x, tau=1, kappa=1, theta=0, log=FALSE)
pasylaplace(x, tau=1, kappa=1, theta=0, log.p=FALSE, lower.tail=TRUE)
varasylaplace(p, tau=1, kappa=1, theta=0, log.p=FALSE, lower.tail=TRUE)
esasylaplace(p, tau=1, kappa=1, theta=0)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, can take any real value, the default is zero |
kappa |
the value of the first scale parameter, must be positive, the default is 1 |
tau |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dasylaplace(x)
pasylaplace(x)
varasylaplace(x)
esasylaplace(x)
Asymmetric power distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the asymmetric power distribution due to Komunjer (2007) given by
\begin{array}{ll}
&\displaystyle
f(x) = \left\{ \begin{array}{ll}
\displaystyle
\frac {\displaystyle \delta^{1 / \lambda}}{\displaystyle \Gamma (1 + 1 / \lambda)}
\exp \left[ -\frac {\delta}{a^\lambda} |x|^\lambda \right], & \mbox{if $x \leq 0$},
\\
\\
\displaystyle
\frac {\displaystyle \delta^{1 / \lambda}}{\displaystyle \Gamma (1 + 1 / \lambda)}
\exp \left[ -\frac {\delta}{(1 - a)^\lambda} |x|^\lambda \right], & \mbox{if $x > 0$,}
\end{array}
\right.
\\
&\displaystyle
F (x) = \left\{ \begin{array}{ll}
\displaystyle
a - a {\cal I} \left( \frac {\delta}{a^\lambda} \sqrt{\lambda} |x|^\lambda, 1 / \lambda \right), & \mbox{if $x \leq 0$,}
\\
\\
\displaystyle
a - (1 - a) {\cal I} \left( \frac {\delta}{(1 - a)^\lambda}
\sqrt{\lambda} |x|^\lambda, 1 / \lambda \right), & \mbox{if $x > 0$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
-\left[ \frac {a^\lambda}{\delta \sqrt{\lambda}} \right]^{1 / \lambda}
\left[ {\cal I}^{-1} \left( 1 - \frac {p}{a}, \frac {1}{\lambda} \right) \right]^{1 / \lambda}, & \mbox{if $p \leq a$,}
\\
\\
\displaystyle
-\left[ \frac {(1 - a)^\lambda}{\delta \sqrt{\lambda}} \right]^{1 / \lambda}
\left[ {\cal I}^{-1} \left( 1 - \frac {1 - p}{1 - a}, \frac {1}{\lambda} \right) \right]^{1 / \lambda}, & \mbox{if $p > a$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
-\frac {1}{p} \left[ \frac {a^\lambda}{\delta \sqrt{\lambda}} \right]^{1 / \lambda}
\int_0^p \left[ {\cal I}^{-1} \left( 1 - \frac {v}{a}, \frac {1}{\lambda} \right) \right]^{1 / \lambda} dv, &
\mbox{if $p \leq a$,}
\\
\\
\displaystyle
-\frac {1}{p} \left[ \frac {a^\lambda}{\delta \sqrt{\lambda}} \right]^{1 / \lambda}
\int_0^a \left[ {\cal I}^{-1} \left( 1 - \frac {v}{a}, \frac {1}{\lambda} \right) \right]^{1 / \lambda} dv
\\
\quad
\displaystyle
-\frac {1}{p} \left[ \frac {(1 - a)^\lambda}{\delta \sqrt{\lambda}} \right]^{1 / \lambda}
\int_a^p \left[ {\cal I}^{-1} \left( 1 -
\frac {1 - v}{1 - a}, \frac {1}{\lambda} \right) \right]^{1 / \lambda} dv, & \mbox{if $p > a$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, 0 < a < 1
, the first scale parameter, \delta > 0
, the second scale parameter,
and \lambda > 0
, the shape parameter,
where {\cal I} (x, \gamma) = \frac {1}{\Gamma (\gamma)} \int_0^{x \sqrt{\gamma}} t^{\gamma - 1} \exp (-t) dt
.
Usage
dasypower(x, a=0.5, lambda=1, delta=1, log=FALSE)
pasypower(x, a=0.5, lambda=1, delta=1, log.p=FALSE, lower.tail=TRUE)
varasypower(p, a=0.5, lambda=1, delta=1, log.p=FALSE, lower.tail=TRUE)
esasypower(p, a=0.5, lambda=1, delta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be in the unit interval, the default is 0.5 |
delta |
the value of the second scale parameter, must be positive, the default is 1 |
lambda |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dasypower(x)
pasypower(x)
varasypower(x)
esasypower(x)
Beard distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Beard distribution due to Beard (1959) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {\displaystyle a \exp (b x) \left[ 1 + a \rho \right]^{\rho^{-1/b}}}
{\displaystyle \left[ 1 + a \rho \exp (b x) \right]^{1 + \rho^{-1/b}}},
\\
&\displaystyle
F (x) = 1 - \frac {\displaystyle \left[ 1 + a \rho \right]^{\rho^{-1/b}}}
{\displaystyle \left[ 1 + a \rho \exp (b x) \right]^{\rho^{-1/b}}},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{b} \log \left[ \frac {1 + a \rho}{a \rho (1 - p)^{\rho^{1 / b}}} - \frac {1}{a \rho} \right],
\\
&\displaystyle
{\rm ES}_p (X) =
\frac {1}{p b} \int_0^p \log \left[ -\frac {1}{a \rho} +
\frac {1 + a \rho}{a \rho (1 - v)^{\rho^{1 / b}}} \right] dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first scale parameter, b > 0
, the second scale parameter,
and \rho > 0
, the shape parameter.
Usage
dbeard(x, a=1, b=1, rho=1, log=FALSE)
pbeard(x, a=1, b=1, rho=1, log.p=FALSE, lower.tail=TRUE)
varbeard(p, a=1, b=1, rho=1, log.p=FALSE, lower.tail=TRUE)
esbeard(p, a=1, b=1, rho=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
rho |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbeard(x)
pbeard(x)
varbeard(x)
esbeard(x)
Beta Burr distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Burr distribution due to Parana\'iba et al. (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {b a^{bd}}{B (c, d)x^{bd + 1}} \left[ 1 + \left( x / a \right)^{-b} \right]^{-c - d},
\\
&\displaystyle
F (x) = I_{\frac {1}{1 + \left( x / a \right)^{-b}}} (c, d),
\\
&\displaystyle
{\rm VaR}_p (X) = a \left[ I_p^{-1} (c, d) \right]^{1 / b} \left[ 1 - I_p^{-1} (c, d) \right]^{-1 / b},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {a}{p} \int_0^p \left[ I_v^{-1} (c, d) \right]^{1 / b}
\left[ 1 - I_v^{-1} (c, d) \right]^{-1 / b} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the scale parameter, b > 0
, the first shape parameter,
c > 0
, the second shape parameter, and d > 0
, the third shape parameter,
where I_x (a, b) = \int_0^x t^{a - 1} (1 - t)^{b - 1} dt / B (a, b)
denotes the incomplete beta function ratio,
B (a, b) = \int_0^1 t^{a - 1} (1 - t)^{b - 1} dt
denotes the beta function,
and I_x^{-1} (a, b)
denotes the inverse function of I_x (a, b)
.
Usage
dbetaburr(x, a=1, b=1, c=1, d=1, log=FALSE)
pbetaburr(x, a=1, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
varbetaburr(p, a=1, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
esbetaburr(p, a=1, b=1, c=1, d=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
d |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetaburr(x)
pbetaburr(x)
varbetaburr(x)
esbetaburr(x)
Beta Burr XII distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Burr XII distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {k c x^{c - 1}}{B (a, b)}
\left[ 1 - \left( 1 + x^c \right)^{-k} \right]^{a - 1}
\left( 1 + x^c \right)^{-b k - 1},
\\
&\displaystyle
F (x) = I_{1 - \left( 1 + x^c \right)^{-k}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \left[ 1 - I_p^{-1} (a, b) \right]^{-1 / k} - 1 \right\}^{1/c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left\{ \left[ 1 - I_v^{-1} (a, b) \right]^{-1 / k} - 1 \right\}^{1/c} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter,
c > 0
, the third shape parameter, and k > 0
, the fourth shape parameter.
Usage
dbetaburr7(x, a=1, b=1, c=1, k=1, log=FALSE)
pbetaburr7(x, a=1, b=1, c=1, k=1, log.p=FALSE, lower.tail=TRUE)
varbetaburr7(p, a=1, b=1, c=1, k=1, log.p=FALSE, lower.tail=TRUE)
esbetaburr7(p, a=1, b=1, c=1, k=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
c |
the value of the third shape parameter, must be positive, the default is 1 |
k |
the value of the fourth shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetaburr7(x)
pbetaburr7(x)
varbetaburr7(x)
esbetaburr7(x)
Beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {x^{a - 1} (1 - x)^{b - 1}}{B (a, b)},
\\
&\displaystyle
F (x) = I_x (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = I_p^{-1} (a, b),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p I_v^{-1} (a, b) dv
\end{array}
for 0 < x < 1
, 0 < p < 1
, a > 0
, the first parameter, and b > 0
, the second shape parameter.
Usage
dbetadist(x, a=1, b=1, log=FALSE)
pbetadist(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varbetadist(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esbetadist(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetadist(x)
pbetadist(x)
varbetadist(x)
esbetadist(x)
Beta exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta exponential distribution due to Nadarajah and Kotz (2006) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\lambda \exp (-b \lambda x)}{B (a, b)}
\left[ 1 - \exp (-\lambda x) \right]^{a - 1},
\\
&\displaystyle
F (x) = I_{1 - \exp (-\lambda x)} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{\lambda} \log \left[ 1 - I_p^{-1} (a, b) \right],
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{p \lambda} \int_0^p \log \left[ 1 - I_v^{-1} (a, b) \right] dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter, and \lambda > 0
,
the scale parameter, where I_x (a, b) = \int_0^x t^{a - 1} (1 - t)^{b - 1} dt / B (a, b)
denotes
the incomplete beta function ratio,
B (a, b) = \int_0^1 t^{a - 1} (1 - t)^{b - 1} dt
denotes the beta function, and
I_x^{-1} (a, b)
denotes the inverse function of I_x (a, b)
.
Usage
dbetaexp(x, lambda=1, a=1, b=1, log=FALSE)
pbetaexp(x, lambda=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varbetaexp(p, lambda=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esbetaexp(p, lambda=1, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetaexp(x)
pbetaexp(x)
varbetaexp(x)
esbetaexp(x)
Beta Frechet distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Fr\'echet distribution due to Barreto-Souza et al. (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\alpha \sigma^\alpha}{x^{\alpha + 1} B (a, b)}
\exp \left\{ -a \left( \frac {\sigma}{x} \right)^{\alpha} \right\}
\left[ 1 - \exp \left\{ -\left( \frac {\sigma}{x} \right)^{\alpha} \right\} \right]^{b - 1},
\\
&\displaystyle
F (x) = I_{\exp \left\{ -\left( \frac {\sigma}{x} \right)^{\alpha} \right\}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \left[ -\log I_p^{-1} (a, b) \right]^{-1 / \alpha},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \left[ -\log I_v^{-1} (a, b) \right]^{-1 / \alpha} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, \sigma > 0
, the scale parameter,
b > 0
, the second shape parameter, and \alpha > 0
, the third shape parameter.
Usage
dbetafrechet(x, a=1, b=1, alpha=1, sigma=1, log=FALSE)
pbetafrechet(x, a=1, b=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varbetafrechet(p, a=1, b=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
esbetafrechet(p, a=1, b=1, alpha=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
alpha |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetafrechet(x)
pbetafrechet(x)
varbetafrechet(x)
esbetafrechet(x)
Beta Gompertz distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Gompertz distribution due to Cordeiro et al. (2012b) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {b \eta \exp (bx)}{B (c, d)}
\exp \left( d \eta \right)
\exp \left[ -d \eta \exp (bx) \right]
\left\{ 1 - \exp \left[ \eta - \eta \exp (bx) \right] \right\}^{c - 1},
\\
&\displaystyle
F(x) = I_{1 - \exp \left[ \eta - \eta \exp (bx) \right]} (c, d),
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{b} \log \left\{ 1 - \frac {1}{\eta}
\log \left[ 1 - I_p^{-1} (c, d) \right] \right\},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p b} \int_0^p \log \left\{ 1 - \frac {1}{\eta} \log
\left[ 1 - I_v^{-1} (c, d) \right] \right\} dv
\end{array}
for x > 0
, 0 < p < 1
, b > 0
, the first scale parameter, \eta > 0
, the second scale parameter,
c > 0
, the first shape parameter, and d > 0
, the second shape parameter.
Usage
dbetagompertz(x, b=1, c=1, d=1, eta=1, log=FALSE)
pbetagompertz(x, b=1, c=1, d=1, eta=1, log.p=FALSE, lower.tail=TRUE)
varbetagompertz(p, b=1, c=1, d=1, eta=1, log.p=FALSE, lower.tail=TRUE)
esbetagompertz(p, b=1, c=1, d=1, eta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the first scale parameter, must be positive, the default is 1 |
eta |
the value of the second scale parameter, must be positive, the default is 1 |
c |
the value of the first shape parameter, must be positive, the default is 1 |
d |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetagompertz(x)
pbetagompertz(x)
varbetagompertz(x)
esbetagompertz(x)
Beta Gumbel distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Gumbel distribution due to Nadarajah and Kotz (2004) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma B (a, b)}
\exp \left( \frac {\mu - x}{\sigma} \right)
\exp \left[ -a \exp \frac {\mu - x}{\sigma} \right]
\left\{ 1 - \exp \left[ -\exp \frac {\mu - x}{\sigma} \right] \right\}^{b - 1},
\\
&\displaystyle
F (x) = I_{\exp \left[ -\exp \frac {\mu - x}{\sigma} \right]} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \sigma \log \left[ -\log I_p^{-1} (a, b) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{p} \int_0^p \log \left[ -\log I_v^{-1} (a, b) \right] dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dbetagumbel(x, a=1, b=1, mu=0, sigma=1, log=FALSE)
pbetagumbel(x, a=1, b=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varbetagumbel(p, a=1, b=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esbetagumbel(p, a=1, b=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetagumbel(x)
pbetagumbel(x)
varbetagumbel(x)
esbetagumbel(x)
Beta Gumbel 2 distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Gumbel II distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b x^{-a - 1}}{B (c, d)} \exp \left( -b d x^{-a} \right) \left[ 1 - \exp \left( -b x^{-a} \right) \right]^{c - 1},
\\
&\displaystyle
F (x) = I_{1 - \exp \left( -b x^{-a} \right)} (c, d),
\\
&\displaystyle
{\rm VaR}_p (X) = b^{1 / a} \left\{ -\log \left[ 1 - I_p^{-1} (c, d) \right] \right\}^{-1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {b^{1 / a}}{p} \int_0^p \left\{ -\log \left[ 1 - I_v^{-1} (c, d) \right] \right\}^{-1 / a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the scale parameter,
c > 0
, the second shape parameter, and d > 0
, the third shape parameter.
Usage
dbetagumbel2(x, a=1, b=1, c=1, d=1, log=FALSE)
pbetagumbel2(x, a=1, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
varbetagumbel2(p, a=1, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
esbetagumbel2(p, a=1, b=1, c=1, d=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
d |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetagumbel2(x)
pbetagumbel2(x)
varbetagumbel2(x)
esbetagumbel2(x, a = 2)
Beta lognormal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta lognormal distribution due to Castellares et al. (2013) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma x B (a, b)}
\phi \left( \frac {\log x - \mu}{\sigma} \right)
\Phi^{a - 1} \left( \frac {\log x - \mu}{\sigma} \right)
\Phi^{b - 1} \left( \frac {\mu - \log x}{\sigma} \right),
\\
&\displaystyle
F (x) = I_{\Phi \left( \frac {\log x - \mu}{\sigma} \right)} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \exp \left[ \mu + \sigma \Phi^{-1} \left( I_p^{-1} (a, b) \right) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\exp (\mu)}{p} \int_0^p \exp \left[ \sigma \Phi^{-1} \left( I_v^{-1} (a, b) \right) \right] dv
\end{array}
for x > 0
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
a > 0
, the first shape parameter, and b > 0
, the second shape parameter,
where \phi (\cdot)
denotes the pdf of a standard normal random variable,
and \Phi (\cdot)
denotes the cdf of a standard normal random variable.
Usage
dbetalognorm(x, a=1, b=1, mu=0, sigma=1, log=FALSE)
pbetalognorm(x, a=1, b=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varbetalognorm(p, a=1, b=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esbetalognorm(p, a=1, b=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetalognorm(x)
pbetalognorm(x)
varbetalognorm(x)
esbetalognorm(x)
Beta Lomax distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Lomax distribution due to Lemonte and Cordeiro (2013) given by
\begin{array}{ll}
&\displaystyle
f (x) =
\frac {\alpha}{\lambda B (a, b)} \left( 1 + \frac {x}{\lambda} \right)^{-b \alpha - 1}
\left[ 1 - \left( 1 + \frac {x}{\lambda} \right)^{-\alpha} \right]^{a - 1},
\\
&\displaystyle
F (x) = I_{1 - \left( 1 + \frac {x}{\lambda} \right)^{-\alpha}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \lambda \left[ 1 - I_p^{-1} (a, b) \right]^{-1 / \alpha} - \lambda,
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\lambda}{p} \int_0^p \left[ 1 - I_v^{-1} (a, b) \right]^{-1 / \alpha} dv - \lambda
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter,
b > 0
, the second shape parameter, \alpha > 0
, the third shape parameter, and \lambda > 0
, the scale parameter.
Usage
dbetalomax(x, a=1, b=1, alpha=1, lambda=1, log=FALSE)
pbetalomax(x, a=1, b=1, alpha=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varbetalomax(p, a=1, b=1, alpha=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
esbetalomax(p, a=1, b=1, alpha=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first scale parameter, must be positive, the default is 1 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
alpha |
the value of the third scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetalomax(x)
pbetalomax(x)
varbetalomax(x)
esbetalomax(x)
Beta normal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta normal distribution due to Eugene et al. (2002) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma B (a, b)}
\phi \left( \frac {x - \mu}{\sigma} \right)
\Phi^{a - 1} \left( \frac {x - \mu}{\sigma} \right) \Phi^{b - 1} \left( \frac {\mu - x}{\sigma} \right),
\\
&\displaystyle
F (x) = I_{\Phi \left( \frac {x - \mu}{\sigma} \right)} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \mu + \sigma \Phi^{-1} \left( I_p^{-1} (a, b) \right),
\\
&\displaystyle
{\rm ES}_p (X) = \mu + \frac {\sigma}{p} \int_0^p \Phi^{-1} \left( I_v^{-1} (a, b) \right) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter,
\sigma > 0
, the scale parameter, a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dbetanorm(x, mu=0, sigma=1, a=1, b=1, log=FALSE)
pbetanorm(x, mu=0, sigma=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varbetanorm(p, mu=0, sigma=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esbetanorm(p, mu=0, sigma=1, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetanorm(x)
pbetanorm(x)
varbetanorm(x)
esbetanorm(x)
Beta Pareto distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Pareto distribution due to Akinsete et al. (2008) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a K^{ad} x^{-ad - 1}}{B (c, d)}
\left[ 1 - \left( \frac {K}{x} \right)^a \right]^{c - 1},
\\
&\displaystyle
F (x) = I_{1 - \left( \frac {K}{x} \right)^a} (c, d),
\\
&\displaystyle
{\rm VaR}_p (X) = K \left[ 1 - I_p^{-1} (c, d) \right]^{-1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {K}{p} \int_0^p \left[ 1 - I_v^{-1} (c, d) \right]^{-1 / a} dv
\end{array}
for x \geq K
, 0 < p < 1
, K > 0
, the scale parameter, a > 0
, the first shape parameter, c > 0
, the second shape parameter, and d > 0
, the third shape parameter.
Usage
dbetapareto(x, K=1, a=1, c=1, d=1, log=FALSE)
pbetapareto(x, K=1, a=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
varbetapareto(p, K=1, a=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
esbetapareto(p, K=1, a=1, c=1, d=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
K |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
d |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetapareto(x)
pbetapareto(x)
varbetapareto(x)
esbetapareto(x)
Beta Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the beta Weibull distribution due to Cordeiro et al. (2012b) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {\alpha x^{\alpha - 1}}{\sigma^\alpha B (a, b)}
\exp \left\{ -b \left( \frac {x}{\sigma} \right)^{\alpha} \right\}
\left[ 1 - \exp \left\{ -\left( \frac {x}{\sigma} \right)^{\alpha} \right\} \right]^{a - 1},
\\
&\displaystyle
F(x) = I_{1 - \exp \left\{ -\left( \frac {x}{\sigma} \right)^{\alpha} \right\}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \left\{ -\log \left[ 1 - I_p^{-1} (a, b) \right] \right\}^{1 / \alpha},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \left\{ -\log \left[ 1 - I_v^{-1} (a, b) \right] \right\}^{1 / \alpha} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter,
b > 0
, the second shape parameter, \alpha > 0
, the third shape parameter, and \sigma > 0
, the scale parameter.
Usage
dbetaweibull(x, a=1, b=1, alpha=1, sigma=1, log=FALSE)
pbetaweibull(x, a=1, b=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varbetaweibull(p, a=1, b=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
esbetaweibull(p, a=1, b=1, alpha=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
alpha |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dbetaweibull(x)
pbetaweibull(x)
varbetaweibull(x)
esbetaweibull(x)
Burr distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Burr distribution due to Burr (1942) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {b a^b}{x^{b + 1}} \left[ 1 + \left( x / a \right)^{-b} \right]^{-2},
\\
&\displaystyle
F (x) = \frac {1}{1 + \left( x / a \right)^{-b}},
\\
&\displaystyle
{\rm VaR}_p (X) = a p^{1 / b} (1 - p)^{-1 / b},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {a}{p} B_p \left( 1 / b + 1, 1 - 1 / b \right)
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the scale parameter, and b > 0
, the shape parameter,
where B_x (a, b) = \int_0^x t^{a - 1} (1 - t)^{b - 1} dt
denotes the incomplete beta function.
Usage
dburr(x, a=1, b=1, log=FALSE)
pburr(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varburr(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esburr(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dburr(x)
pburr(x)
varburr(x)
esburr(x)
Burr XII distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Burr XII distribution due to Burr (1942) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {k c x^{c - 1}}{\left( 1 + x^c \right)^{k + 1}},
\\
&\displaystyle
F (x) = 1 - \left( 1 + x^c \right)^{-k},
\\
&\displaystyle
{\rm VaR}_p (X) = \left[ (1 - p)^{-1 / k} - 1 \right]^{1/c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left[ (1 - v)^{-1 / k} - 1 \right]^{1/c} dv
\end{array}
for x > 0
, 0 < p < 1
, c > 0
, the first shape parameter, and k > 0
, the second shape parameter.
Usage
dburr7(x, k=1, c=1, log=FALSE)
pburr7(x, k=1, c=1, log.p=FALSE, lower.tail=TRUE)
varburr7(p, k=1, c=1, log.p=FALSE, lower.tail=TRUE)
esburr7(p, k=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
k |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dburr7(x)
pburr7(x)
varburr7(x)
esburr7(x)
Chen distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Chen distribution due to Chen (2000) given by
\begin{array}{ll}
&\displaystyle
f(x) = \lambda b x^{b - 1} \exp \left( x^b \right) \exp \left[ \lambda - \lambda \exp \left( x^b \right) \right],
\\
&\displaystyle
F (x) = 1 - \exp \left[ \lambda - \lambda \exp \left( x^b \right) \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \log \left[ 1 - \frac {\log (1 - p)}{\lambda} \right] \right\}^{1 / b},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left\{ \log \left[ 1 - \frac {\log (1 - v)}{\lambda} \right] \right\}^{1 / b} dv
\end{array}
for x > 0
, 0 < p < 1
, b > 0
, the shape parameter, and \lambda > 0
, the scale parameter.
Usage
dchen(x, b=1, lambda=1, log=FALSE)
pchen(x, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varchen(p, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
eschen(p, b=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dchen(x)
pchen(x)
varchen(x)
eschen(x)
Compound Laplace gamma distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the compound Laplace gamma distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b}{2} \left\{ 1 + b \left | x - \theta \right | \right\}^{-\left( a + 1 \right)},
\\
&\displaystyle
F (x) =
\left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2} \left\{ 1 + b \left | x - \theta \right | \right\}^{-a}, &
\mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
1 - \frac {1}{2} \left\{ 1 + b \left | x - \theta \right | \right\}^{-a}, &
\mbox{if $x > \theta$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\theta - \frac {1}{b} - \frac {(2 p)^{-1/a}}{b}, & \mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\theta - \frac {1}{b} + \frac {(2 (1 - p))^{-1/a}}{b}, &
\mbox{if $p > 1/2$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\theta - \frac {1}{b} - \frac {(2 p)^{-1/a}}{b (1 - 1/a)}, &
\mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\theta - \frac {1}{b} - \frac {\left[ 2 (1 - p) \right]^{1 - 1/a}}{2 p b (1 - 1/a)}, &
\mbox{if $p > 1/2$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \theta < \infty
, the location parameter,
b > 0
, the scale parameter, and a > 0
, the shape parameter.
Usage
dclg(x, a=1, b=1, theta=0, log=FALSE)
pclg(x, a=1, b=1, theta=0, log.p=FALSE, lower.tail=TRUE)
varclg(p, a=1, b=1, theta=0, log.p=FALSE, lower.tail=TRUE)
esclg(p, a=1, b=1, theta=0)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, can take any real value, the default is zero |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dclg(x)
pclg(x)
varclg(x)
esclg(x)
Complementary beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the complementary beta distribution due to Jones (2002) given by
\begin{array}{ll}
&\displaystyle
f (x) = B (a, b)
\left\{ I_x^{-1} (a, b) \right\}^{1 - a}
\left\{ 1 - I_x^{-1} (a, b) \right\}^{1 - b},
\\
&\displaystyle
F (x) = I_x^{-1} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = I_p (a, b),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p I_v (a, b) dv
\end{array}
for 0 < x < 1
, 0 < p < 1
, a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dcompbeta(x, a=1, b=1, log=FALSE)
pcompbeta(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varcompbeta(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
escompbeta(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dcompbeta(x)
pcompbeta(x)
varcompbeta(x)
escompbeta(x)
Dagum distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Dagum distribution due to Dagum (1975, 1977, 1980) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a c b^a x^{a c - 1}}{\left[ x^a + b^a \right]^{c + 1}},
\\
&\displaystyle
F (x) = \left[ 1 + \left( \frac {b}{x} \right)^a \right]^{-c},
\\
&\displaystyle
{\rm VaR}_p (X) = b \left( 1- p^{-1 / c} \right)^{-1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {b}{p} \int_0^p \left( 1 - v^{-1 / c} \right)^{-1 / a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the scale parameter, and c > 0
, the second shape parameter.
Usage
ddagum(x, a=1, b=1, c=1, log=FALSE)
pdagum(x, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
vardagum(p, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
esdagum(p, a=1, b=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
ddagum(x)
pdagum(x)
vardagum(x)
esdagum(x)
Double Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the double Weibull distribution due to Balakrishnan and Kocherlakota (1985) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {c}{\displaystyle 2 \sigma}
\left | \frac {x - \mu}{\sigma} \right |^{c - 1}
\exp \left\{ -\left | \frac {x - \mu}{\sigma} \right |^c \right\},
\\
&\displaystyle
F (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2} \exp \left\{ -\left( \frac {\mu - x}{\sigma} \right)^c \right\}, & \mbox{if $x \leq \mu$,}
\\
\\
\displaystyle
1 - \frac {1}{2} \exp \left\{ -\left( \frac {x - \mu}{\sigma} \right)^c \right\}, & \mbox{if $x > \mu$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\mu - \sigma \left[ -\log \left( 2 p \right) \right]^{1 / c}, & \mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\mu + \sigma \left[ -\log \left( 2 (1 - p) \right) \right]^{1 / c}, & \mbox{if $p > 1/2$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\mu - \frac {\sigma}{p} \int_0^p \left[ -\log 2 - \log v \right]^{1 / c} dv, & \mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\mu - \frac {\sigma}{p} \int_0^{1/2} \left[ -\log 2 - \log v \right]^{1 / c} dv
\\
\quad
\displaystyle
+ \frac {\sigma}{p}
\int_{1/2}^p \left[ -\log 2 - \log (1 - v) \right]^{1 / c} dv, & \mbox{if $p > 1/2$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter,
\sigma > 0
, the scale parameter, and c > 0
, the shape parameter.
Usage
ddweibull(x, c=1, mu=0, sigma=1, log=FALSE)
pdweibull(x, c=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
vardweibull(p, c=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esdweibull(p, c=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
c |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
ddweibull(x)
pdweibull(x)
vardweibull(x)
esdweibull(x)
Exponentiated exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponentiated exponential distribution due to Gupta and Kundu (1999, 2001) given by
\begin{array}{ll}
&\displaystyle
f (x) = a \lambda \exp (-\lambda x)
\left[ 1 - \exp (-\lambda x) \right]^{a - 1},
\\
&\displaystyle
F (x) = \left[ 1 - \exp (-\lambda x) \right]^{a},
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{\lambda} \log \left( 1 - p^{1 / a} \right),
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{p \lambda} \int_0^p \log \left( 1 - v^{1 / a} \right) dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter and \lambda > 0
, the scale parameter.
Usage
dexpexp(x, lambda=1, a=1, log=FALSE)
pexpexp(x, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
varexpexp(p, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
esexpexp(p, lambda=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexpexp(x)
pexpexp(x)
varexpexp(x)
esexpexp(x)
Exponential extension distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponential extension distribution due to Nadarajah and Haghighi (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = a \lambda (1 + \lambda x)^{a - 1} \exp \left[ 1 - (1 + \lambda x)^a \right],
\\
&\displaystyle
F (x) = 1 - \exp \left[ 1 - (1 + \lambda x)^a \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {\left[ 1 - \log (1 - p) \right]^{1 / a} - 1}{\lambda},
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{\lambda} + \frac {1}{\lambda p} \int_0^p \left[ 1 - \log (1 - v) \right]^{1 / a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter and \lambda > 0
, the scale parameter.
Usage
dexpext(x, lambda=1, a=1, log=FALSE)
pexpext(x, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
varexpext(p, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
esexpext(p, lambda=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexpext(x)
pexpext(x)
varexpext(x)
esexpext(x)
Exponential geometric distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponential geometric distribution due to Adamidis and Loukas (1998) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {\lambda \theta \exp (-\lambda x)}{\left[ 1 - (1 - \theta) \exp (-\lambda x) \right]^2},
\\
&\displaystyle
F (x) = \frac {\theta \exp (-\lambda x)}{1 - (1 - \theta) \exp (-\lambda x)},
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{\lambda} \log \frac {p}{\theta + (1 - \theta) p},
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {\log p}{\lambda} - \frac {\theta \log \theta}{\lambda p (1 - \theta)} +
\frac {\theta + (1 - \theta) p}{\lambda p (1 - \theta)} \log \left[ \theta + (1 - \theta) p \right]
\end{array}
for x > 0
, 0 < p < 1
, 0 < \theta < 1
, the first scale parameter, and \lambda > 0
, the second scale parameter.
Usage
dexpgeo(x, theta=0.5, lambda=1, log=FALSE)
pexpgeo(x, theta=0.5, lambda=1, log.p=FALSE, lower.tail=TRUE)
varexpgeo(p, theta=0.5, lambda=1, log.p=FALSE, lower.tail=TRUE)
esexpgeo(p, theta=0.5, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the first scale parameter, must be in the unit interval, the default is 0.5 |
lambda |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexpgeo(x)
pexpgeo(x)
varexpgeo(x)
esexpgeo(x)
Exponential logarithmic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponential logarithmic distribution due to Tahmasbi and Rezaei (2008) given by
\begin{array}{ll}
&\displaystyle
f(x) = -\frac {b (1 - a) \exp (-b x)}{\log a \left[ 1 - (1 - a) \exp (-b x) \right]},
\\
&\displaystyle
F (x) = 1 - \frac {\log \left[ 1 - (1 - a) \exp (-b x) \right]}{\log a},
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{b} \log \left[ \frac {1 - a^{1 - p}}{1 - a} \right],
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{b p} \int_0^p \log \left[ \frac {1 - a^{1 - v}}{1 - a} \right] dv
\end{array}
for x > 0
, 0 < p < 1
, 0 < a < 1
, the first scale parameter, and b > 0
, the second scale parameter.
Usage
dexplog(x, a=0.5, b=1, log=FALSE)
pexplog(x, a=0.5, b=1, log.p=FALSE, lower.tail=TRUE)
varexplog(p, a=0.5, b=1, log.p=FALSE, lower.tail=TRUE)
esexplog(p, a=0.5, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be in the unit interval, the default is 0.5 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexplog(x)
pexplog(x)
varexplog(x)
esexplog(x)
Exponentiated logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponentiated logistic distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = (a/b) \exp (-x/b)
\left[ 1 + \exp (-x/b) \right]^{-a - 1},
\\
&\displaystyle
F (x) = \left[ 1 + \exp (-x/b) \right]^{-a},
\\
&\displaystyle
{\rm VaR}_p (X) = -b \log \left[ p^{-1 / a} - 1 \right],
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {b}{p} \int_0^p \log \left[ v^{-1 / a} - 1 \right] dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, a > 0
, the shape parameter, and b > 0
, the scale parameter.
Usage
dexplogis(x, a=1, b=1, log=FALSE)
pexplogis(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varexplogis(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esexplogis(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexplogis(x)
pexplogis(x)
varexplogis(x)
esexplogis(x)
Exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponential distribution given by
\begin{array}{ll}
&\displaystyle
f(x) = \lambda \exp (-\lambda x),
\\
&\displaystyle
F (x) = 1 - \exp (-\lambda x),
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{\lambda} \log (1 - p),
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{p \lambda} \left\{ \log (1 - p) p - p - \log (1 - p) \right\}
\end{array}
for x > 0
, 0 < p < 1
, and \lambda > 0
, the scale parameter.
Usage
dexponential(x, lambda=1, log=FALSE)
pexponential(x, lambda=1, log.p=FALSE, lower.tail=TRUE)
varexponential(p, lambda=1, log.p=FALSE, lower.tail=TRUE)
esexponential(p, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexponential(x)
pexponential(x)
varexponential(x)
esexponential(x)
Exponential Poisson distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponential Poisson distribution due to Kus (2007) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {b \lambda \exp \left[ -b x - \lambda + \lambda \exp (-b x) \right]}{1 - \exp (-\lambda)},
\\
&\displaystyle
F (x) = \frac {1 - \exp \left[ -\lambda + \lambda \exp (-b x) \right]}{1 - \exp (-\lambda)},
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{b} \log \left\{ \frac {1}{\lambda} \log \left[ 1 - p + p \exp (-\lambda) \right] + 1 \right\},
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{b p} \int_0^p \log \left\{ \frac {1}{\lambda} \log
\left[ 1 - v + v \exp (-\lambda) \right] + 1 \right\} dv
\end{array}
for x > 0
, 0 < p < 1
, b > 0
, the first scale parameter, and \lambda > 0
, the second scale parameter.
Usage
dexppois(x, b=1, lambda=1, log=FALSE)
pexppois(x, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varexppois(p, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
esexppois(p, b=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the first scale parameter, must be positive, the default is 1 |
lambda |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexppois(x)
pexppois(x)
varexppois(x)
esexppois(x)
Exponential power distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponential power distribution due to Subbotin (1923) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\displaystyle 2 a^{1/a} \sigma \Gamma \left( 1 + 1/a \right)}
\exp \left\{ -\frac {\mid x - \mu \mid^a}{a \sigma^a} \right\},
\\
&\displaystyle
F (x) =
\left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2} Q \left( \frac {1}{a}, \frac {(\mu - x)^a}{a \sigma^a} \right), & \mbox{if $x \leq \mu$,}
\\
\\
\displaystyle
1 - \frac {1}{2} Q \left( \frac {1}{a}, \frac {(x - \mu)^a}{a \sigma^a} \right), & \mbox{if $x > \mu$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\mu - a^{1/a} \sigma \left[ Q^{-1} \left( \frac {1}{a}, 2 p \right) \right]^{1/a}, & \mbox{if $p \leq 1/2$,}
\\
\\
\mu + a^{1/a} \sigma \left[ Q^{-1} \left( \frac {1}{a}, 2 (1 - p) \right) \right]^{1/a}, & \mbox{if $p > 1/2$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\mu - \frac {a^{1/a} \sigma}{p} \int_0^p \left[ Q^{-1} \left( \frac {1}{a}, 2 v \right) \right]^{1/a} dv, & \mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\mu - \frac {a^{1/a} \sigma}{p} \int_0^{1/2} \left[ Q^{-1} \left( \frac {1}{a}, 2 v \right) \right]^{1/a} dv
\\
\displaystyle
\quad
+\frac {a^{1/a} \sigma}{p} \int_{1/2}^p \left[ Q^{-1} \left( \frac {1}{a}, 2 (1 - v) \right) \right]^{1/a} dv, & \mbox{if $p > 1/2$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter, and
a > 0
, the shape parameter.
Usage
dexppower(x, mu=0, sigma=1, a=1, log=FALSE)
pexppower(x, mu=0, sigma=1, a=1, log.p=FALSE, lower.tail=TRUE)
varexppower(p, mu=0, sigma=1, a=1, log.p=FALSE, lower.tail=TRUE)
esexppower(p, mu=0, sigma=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexppower(x)
pexppower(x)
varexppower(x)
esexppower(x)
Exponentiated Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the exponentiated Weibull distribution due to Mudholkar and Srivastava (1993) and Mudholkar et al. (1995) given by
\begin{array}{ll}
&\displaystyle
f(x) = a \alpha \sigma^{-\alpha} x^{\alpha - 1}
\exp \left[ -(x / \sigma)^\alpha \right]
\left\{ 1 - \exp \left[ -(x / \sigma)^\alpha \right] \right\}^{a - 1},
\\
&\displaystyle
F (x) = \left\{ 1 - \exp \left[ -(x / \sigma)^\alpha \right] \right\}^a,
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \left[ -\log \left( 1 - p^{1 / a} \right) \right]^{1 / \alpha},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \left[ -\log \left( 1 - v^{1 / a} \right) \right]^{1 / \alpha} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter,
\alpha > 0
, the second shape parameter, and \sigma > 0
, the scale parameter.
Usage
dexpweibull(x, a=1, alpha=1, sigma=1, log=FALSE)
pexpweibull(x, a=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varexpweibull(p, a=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
esexpweibull(p, a=1, alpha=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
alpha |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dexpweibull(x)
pexpweibull(x)
varexpweibull(x)
esexpweibull(x)
Frechet distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Fr\'echet distribution due to Fr\'echet (1927) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\alpha \sigma^\alpha}{x^{\alpha + 1}} \exp \left\{ -\left( \frac {\sigma}{x} \right)^{\alpha} \right\},
\\
&\displaystyle
F (x) = \exp \left\{ -\left( \frac {\sigma}{x} \right)^{\alpha} \right\},
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \left[ -\log p \right]^{-1 / \alpha},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \Gamma \left( 1 - 1 / \alpha, -\log p \right)
\end{array}
for x > 0
, 0 < p < 1
, \alpha > 0
, the shape parameter, and \sigma > 0
, the scale parameter,
where \Gamma (a, x) = \int_x^\infty t^{a - 1} \exp \left( -t \right) dt
denotes the complementary incomplete gamma function.
Usage
dfrechet(x, alpha=1, sigma=1, log=FALSE)
pfrechet(x, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varfrechet(p, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
esfrechet(p, alpha=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
alpha |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dfrechet(x)
pfrechet(x)
varfrechet(x)
esfrechet(x)
Generalized beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized beta distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {(x - c)^{a - 1} (d - x)^{b - 1}}{B (a, b) (d - c)^{a + b - 1}},
\\
&\displaystyle
F (x) = I_{\frac {x - c}{d - c}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = c + (d - c) I_p^{-1} (a, b),
\\
&\displaystyle
{\rm ES}_p (X) = c + \frac {d - c}{p} \int_0^p I_v^{-1} (a, b) dv
\end{array}
for c \leq x \leq d
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter, -\infty < c < \infty
, the first location parameter, and -\infty < c < d < \infty
, the second location parameter.
Usage
dgenbeta(x, a=1, b=1, c=0, d=1, log=FALSE)
pgenbeta(x, a=1, b=1, c=0, d=1, log.p=FALSE, lower.tail=TRUE)
vargenbeta(p, a=1, b=1, c=0, d=1, log.p=FALSE, lower.tail=TRUE)
esgenbeta(p, a=1, b=1, c=0, d=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
c |
the value of the first location parameter, can take any real value, the default is zero |
d |
the value of the second location parameter, can take any real value but must be greater than c, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenbeta(x)
pgenbeta(x)
vargenbeta(x)
esgenbeta(x)
Generalized beta II distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized beta II distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {c x^{ac - 1} \left( 1 - x^c \right)^{b - 1}}{B (a, b)},
\\
&\displaystyle
F (x) = I_{x^c} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \left[ I_p^{-1} (a, b) \right]^{1 / c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left[ I_v^{-1} (a, b) \right]^{1 / c} dv
\end{array}
for 0 < x < 1
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter, and c > 0
, the third shape parameter.
Usage
dgenbeta2(x, a=1, b=1, c=1, log=FALSE)
pgenbeta2(x, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
vargenbeta2(p, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
esgenbeta2(p, a=1, b=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
c |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenbeta2(x)
pgenbeta2(x)
vargenbeta2(x)
esgenbeta2(x)
Generalized inverse beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized inverse beta distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a x^{ac - 1}}{B (c, d) \left( 1 + x^a \right)^{c + d}},
\\
&\displaystyle
F (x) = I_{\frac {x^a}{1 + x^a}} (c, d),
\\
&\displaystyle
{\rm VaR}_p (X) = \left[ \frac {I_p^{-1} (c, d)}{1 - I_p^{-1} (c, d)} \right]^{1/a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left[ \frac {I_v^{-1} (c, d)}{1 - I_v^{-1} (c, d)} \right]^{1/a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, c > 0
, the second shape parameter, and d > 0
, the third shape parameter.
Usage
dgeninvbeta(x, a=1, c=1, d=1, log=FALSE)
pgeninvbeta(x, a=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
vargeninvbeta(p, a=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
esgeninvbeta(p, a=1, c=1, d=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
d |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgeninvbeta(x)
pgeninvbeta(x)
vargeninvbeta(x)
esgeninvbeta(x)
Generalized logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized logistic distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a \exp \left( -\frac {x - \mu}{\sigma} \right)}
{\sigma \left\{ 1 + \exp \left( -\frac {x - \mu}{\sigma} \right) \right\}^{1 + a}},
\\
&\displaystyle
F (x) = \frac {1}{\left\{ 1 + \exp \left( -\frac {x - \mu}{\sigma} \right) \right\}^a},
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \sigma \log \left( p^{-1 / a} - 1 \right),
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{p} \int_0^p \log \left( v^{-1 / a} - 1 \right) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
and a > 0
, the shape parameter.
Usage
dgenlogis(x, a=1, mu=0, sigma=1, log=FALSE)
pgenlogis(x, a=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
vargenlogis(p, a=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esgenlogis(p, a=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenlogis(x)
pgenlogis(x)
vargenlogis(x)
esgenlogis(x)
Generalized logistic III distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized logistic III distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma B (\alpha, \alpha)} \exp \left( \alpha \frac {x - \mu}{\sigma} \right)
\left\{ 1 + \exp \left( \frac {x - \mu}{\sigma} \right) \right\}^{-2 \alpha},
\\
&\displaystyle
F (x) = I_{\frac {1}{1 + \exp \left( -\frac {x - \mu}{\sigma} \right)}} (\alpha, \alpha),
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \sigma \log \frac {1 - I_p^{-1} (\alpha, \alpha)}{I_p^{-1} (\alpha, \alpha)},
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{p} \int_0^p \log \frac {1 - I_v^{-1} (\alpha, \alpha)}{I_v^{-1} (\alpha, \alpha)} dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
and \alpha > 0
, the shape parameter.
Usage
dgenlogis3(x, alpha=1, mu=0, sigma=1, log=FALSE)
pgenlogis3(x, alpha=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
vargenlogis3(p, alpha=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esgenlogis3(p, alpha=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
alpha |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenlogis3(x)
pgenlogis3(x)
vargenlogis3(x)
esgenlogis3(x)
Generalized logistic IV distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized logistic IV distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma B (\alpha, a)}
\exp \left( -\alpha \frac {x - \mu}{\sigma} \right) \left\{ 1 + \exp \left( -\frac {x - \mu}{\sigma} \right) \right\}^{-\alpha - a},
\\
&\displaystyle
F (x) = I_{\frac {1}{1 + \exp \left( -\frac {x - \mu}{\sigma} \right)}} (\alpha, a),
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \sigma \log \frac {1 - I_p^{-1} (\alpha, a)}{I_p^{-1} (\alpha, a)},
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{p} \int_0^p \log \frac {1 - I_v^{-1} (\alpha, a)}{I_v^{-1} (\alpha, a)} dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
\alpha > 0
, the first shape parameter, and a > 0
, the second shape parameter.
Usage
dgenlogis4(x, a=1, alpha=1, mu=0, sigma=1, log=FALSE)
pgenlogis4(x, a=1, alpha=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
vargenlogis4(p, a=1, alpha=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esgenlogis4(p, a=1, alpha=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
alpha |
the value of the first shape parameter, must be positive, the default is 1 |
a |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenlogis4(x)
pgenlogis4(x)
vargenlogis4(x)
esgenlogis4(x)
Generalized Pareto distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized Pareto distribution due to Pickands (1975) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{k} \left( 1 - \frac {c x}{k} \right)^{1 / c - 1},
\\
&\displaystyle
F (x) = 1 - \left( 1 - \frac {c x}{k} \right)^{1 / c},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {k}{c} \left[ 1 - (1 - p)^c \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {k}{c} + \frac {k (1 - p)^{c + 1}}{p c (c + 1)} - \frac {k}{p c (c + 1)}
\end{array}
for x < k/c
if c > 0
, x > k/c
if c < 0
, x > 0
if c = 0
, 0 < p < 1
,
k > 0
, the scale parameter and -\infty < c < \infty
, the shape parameter.
Usage
dgenpareto(x, k=1, c=1, log=FALSE)
pgenpareto(x, k=1, c=1, log.p=FALSE, lower.tail=TRUE)
vargenpareto(p, k=1, c=1, log.p=FALSE, lower.tail=TRUE)
esgenpareto(p, k=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
k |
the value of the scale parameter, must be positive, the default is 1 |
c |
the value of the shape parameter, can take any real value, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenpareto(x)
pgenpareto(x)
vargenpareto(x)
esgenpareto(x)
Generalized power Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized power Weibull distribution due to Nikulin and Haghighi (2006) given by
\begin{array}{ll}
&\displaystyle
f(x) = a \theta x^{a - 1} \left[ 1 + x^a \right]^{\theta - 1}
\exp \left\{ 1 - \left[ 1 + x^a \right]^\theta \right\},
\\
&\displaystyle
F (x) = 1 - \exp \left\{ 1 - \left[ 1 + x^a \right]^\theta \right\},
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \left[ 1 - \log (1 - p) \right]^{1 / \theta} - 1 \right\}^{1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left\{ \left[ 1 - \log (1 - v) \right]^{1 / \theta} - 1 \right\}^{1 / a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, and \theta > 0
, the second shape parameter.
Usage
dgenpowerweibull(x, a=1, theta=1, log=FALSE)
pgenpowerweibull(x, a=1, theta=1, log.p=FALSE, lower.tail=TRUE)
vargenpowerweibull(p, a=1, theta=1, log.p=FALSE, lower.tail=TRUE)
esgenpowerweibull(p, a=1, theta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
theta |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenpowerweibull(x)
pgenpowerweibull(x)
vargenpowerweibull(x)
esgenpowerweibull(x)
Generalized uniform distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized uniform distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = h k c (x - a)^{c - 1} \left[ 1 - k (x - a)^c \right]^{h - 1},
\\
&\displaystyle
F (x) = 1 - \left[ 1 - k (x - a)^c \right]^h,
\\
&\displaystyle
{\rm VaR}_p (X) = a + k^{-1/c} \left[ 1 - (1 - p)^{1/h} \right]^{1/c},
\\
&\displaystyle
{\rm ES}_p (X) = a + \frac {k^{-1/c}}{p} \int_0^p \left[ 1 - (1 - v)^{1/h} \right]^{1/c} dv
\end{array}
for a \leq x \leq a + k^{-1/c}
, 0 < p < 1
, -\infty < a < \infty
, the location parameter, c > 0
, the first shape parameter, k > 0
, the scale parameter, and h > 0
, the second shape parameter.
Usage
dgenunif(x, a=0, c=1, h=1, k=1, log=FALSE)
pgenunif(x, a=0, c=1, h=1, k=1, log.p=FALSE, lower.tail=TRUE)
vargenunif(p, a=0, c=1, h=1, k=1, log.p=FALSE, lower.tail=TRUE)
esgenunif(p, a=0, c=1, h=1, k=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the location parameter, can take any real value, the default is zero |
k |
the value of the scale parameter, must be positive, the default is 1 |
c |
the value of the first scale parameter, must be positive, the default is 1 |
h |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgenunif(x)
pgenunif(x)
vargenunif(x)
esgenunif(x)
Generalized extreme value distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the generalized extreme value distribution due to Fisher and Tippett (1928) given by
\begin{array}{ll}
&\displaystyle
f(x) =
\frac {1}{\sigma} \left[ 1 + \xi \left( \frac {x - \mu}{\sigma} \right) \right]^{-1/\xi - 1}
\exp \left\{ -\left[ 1 + \xi \left( \frac {x - \mu}{\sigma} \right)
\right]^{-1/\xi} \right\},
\\
&\displaystyle
F(x) = \exp \left\{ -\left[ 1 + \xi \left( \frac {x - \mu}{\sigma} \right) \right]^{-1/\xi} \right\},
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \frac {\sigma}{\xi} + \frac {\sigma}{\xi} (-\log p)^{-\xi},
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{\xi} + \frac {\sigma}{p \xi} \int_0^p (-\log v)^{-\xi} dv
\end{array}
for x \geq \mu - \sigma / \xi
if \xi > 0
,
x \leq \mu - \sigma / \xi
if \xi < 0
,
-\infty < x < \infty
if \xi = 0
,
0 < p < 1
, -\infty < \mu < \infty
, the location parameter,
\sigma > 0
, the scale parameter, and -\infty < \xi < \infty
, the shape parameter.
Usage
dgev(x, mu=0, sigma=1, xi=1, log=FALSE)
pgev(x, mu=0, sigma=1, xi=1, log.p=FALSE, lower.tail=TRUE)
vargev(p, mu=0, sigma=1, xi=1, log.p=FALSE, lower.tail=TRUE)
esgev(p, mu=0, sigma=1, xi=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
xi |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgev(x)
pgev(x)
vargev(x)
esgev(x)
Gompertz distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Gompertz distribution due to Gompertz (1825) given by
\begin{array}{ll}
&\displaystyle
f(x) = b \eta \exp (bx) \exp \left[ \eta - \eta \exp (bx) \right],
\\
&\displaystyle
F (x) = 1 - \exp \left[ \eta - \eta \exp (bx) \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{b} \log \left[ 1 - \frac {1}{\eta} \log (1 - p) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p b} \int_0^p \log \left[ 1 - \frac {1}{\eta} \log (1 - v) \right] dv
\end{array}
for x > 0
, 0 < p < 1
, b > 0
, the first scale parameter and \eta > 0
, the second scale parameter.
Usage
dgompertz(x, b=1, eta=1, log=FALSE)
pgompertz(x, b=1, eta=1, log.p=FALSE, lower.tail=TRUE)
vargompertz(p, b=1, eta=1, log.p=FALSE, lower.tail=TRUE)
esgompertz(p, b=1, eta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the first scale parameter, must be positive, the default is 1 |
eta |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgompertz(x)
pgompertz(x)
vargompertz(x)
esgompertz(x)
Gumbel distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Gumbel distribution given by due to Gumbel (1954) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma} \exp \left( \frac {\mu - x}{\sigma} \right)
\exp \left[ -\exp \left( \frac {\mu - x}{\sigma} \right) \right],
\\
&\displaystyle
F (x) = \exp \left[ -\exp \left( \frac {\mu - x}{\sigma} \right) \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \sigma \log (-\log p),
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{p} \int_0^p \log (-\log v) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and \sigma > 0
, the scale parameter.
Usage
dgumbel(x, mu=0, sigma=1, log=FALSE)
pgumbel(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
vargumbel(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esgumbel(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgumbel(x)
pgumbel(x)
vargumbel(x)
esgumbel(x)
Gumbel II distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Gumbel II distribution
\begin{array}{ll}
&\displaystyle
f (x) = a b x^{-a - 1} \exp \left( -b x^{-a} \right),
\\
&\displaystyle
F (x) = 1 - \exp \left( -b x^{-a} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = b^{1 / a} \left[ -\log (1 - p) \right]^{-1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {b^{1 / a}}{p} \int_0^p \left[ -\log (1 - v) \right]^{-1 / a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter, and b > 0
, the scale parameter.
Usage
dgumbel2(x, a=1, b=1, log=FALSE)
pgumbel2(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
vargumbel2(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esgumbel2(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dgumbel2(x)
pgumbel2(x)
vargumbel2(x)
esgumbel2(x)
Half Student's t distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the half Student's t
distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {2 \Gamma \left( \frac {n + 1}{2} \right)}{\sqrt{n \pi} \Gamma \left( \frac {n}{2} \right)}
\left( 1 + \frac {x^2}{n} \right)^{-\frac {n + 1}{2}},
\\
&\displaystyle
F (x) = I_{\frac {x^2}{x^2 + n}} \left( \frac {1}{2}, \frac {n}{2} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \sqrt{\frac {n I_p^{-1} \left( \frac {1}{2}, \frac {n}{2} \right)}
{1 - I_p^{-1} \left( \frac {1}{2}, \frac {n}{2} \right)}},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sqrt{n}}{p} \int_0^p
\sqrt{\frac {I_v^{-1} \left( \frac {1}{2}, \frac {n}{2} \right)}
{1 - I_v^{-1} \left( \frac {1}{2}, \frac {n}{2} \right)}} dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, and n > 0
, the degree of freedom parameter.
Usage
dhalfT(x, n=1, log=FALSE)
phalfT(x, n=1, log.p=FALSE, lower.tail=TRUE)
varhalfT(p, n=1, log.p=FALSE, lower.tail=TRUE)
eshalfT(p, n=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
n |
the value of the degree of freedom parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dhalfT(x)
phalfT(x)
varhalfT(x)
eshalfT(x)
Half Cauchy distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the half Cauchy distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {2}{\pi} \frac {\sigma}{x^2 + \sigma^2},
\\
&\displaystyle
F (x) = \frac {2}{\pi} \arctan \left( \frac {x}{\sigma} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \tan \left( \frac {\pi p}{2} \right),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \tan \left( \frac {\pi v}{2} \right) dv
\end{array}
for x > 0
, 0 < p < 1
, and \sigma > 0
, the scale parameter.
Usage
dhalfcauchy(x, sigma=1, log=FALSE)
phalfcauchy(x, sigma=1, log.p=FALSE, lower.tail=TRUE)
varhalfcauchy(p, sigma=1, log.p=FALSE, lower.tail=TRUE)
eshalfcauchy(p, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dhalfcauchy(x)
phalfcauchy(x)
varhalfcauchy(x)
eshalfcauchy(x)
Half logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the half logistic distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {2 \lambda \exp \left( -\lambda x \right)}
{\left[ 1 + \exp \left( -\lambda x \right) \right]^2},
\\
&\displaystyle
F (x) = \frac {1 - \exp \left( -\lambda x \right)}{1 + \exp \left( -\lambda x \right)},
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{\lambda} \log \frac {1 - p}{1 + p},
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{\lambda} \log \frac {1 - p}{1 + p} + \frac {1}{\lambda p} \log \left( 1 - p^2 \right)
\end{array}
for x > 0
, 0 < p < 1
, and \lambda > 0
, the scale parameter.
Usage
dhalflogis(x, lambda=1, log=FALSE)
phalflogis(x, lambda=1, log.p=FALSE, lower.tail=TRUE)
varhalflogis(p, lambda=1, log.p=FALSE, lower.tail=TRUE)
eshalflogis(p, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dhalflogis(x)
phalflogis(x)
varhalflogis(x)
eshalflogis(x)
Half normal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for Half normal distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {2}{\sigma} \phi \left( \frac {x}{\sigma} \right),
\\
&\displaystyle
F (x) = 2 \Phi \left( \frac {x}{\sigma} \right) - 1,
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \Phi^{-1} \left( \frac {1 + p}{2} \right),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \Phi^{-1} \left( \frac {1 + v}{2} \right) dv
\end{array}
for x > 0
, 0 < p < 1
, and \sigma > 0
, the scale parameter.
Usage
dhalfnorm(x, sigma=1, log=FALSE)
phalfnorm(x, sigma=1, log.p=FALSE, lower.tail=TRUE)
varhalfnorm(p, sigma=1, log.p=FALSE, lower.tail=TRUE)
eshalfnorm(p, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dhalfnorm(x)
phalfnorm(x)
varhalfnorm(x)
eshalfnorm(x)
Inverse beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the inverse beta distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {x^{a - 1}}{B (a, b) (1 + x)^{a + b}},
\\
&\displaystyle
F (x) = I_{\frac {x}{1 + x}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {I_p^{-1} (a, b)}{1 - I_p^{-1} (a, b)},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \frac {I_v^{-1} (a, b)}{1 - I_v^{-1} (a, b)} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dinvbeta(x, a=1, b=1, log=FALSE)
pinvbeta(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varinvbeta(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esinvbeta(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dinvbeta(x)
pinvbeta(x)
varinvbeta(x)
esinvbeta(x)
Inverse exponentiated exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the inverse exponentiated exponential distribution due to Ghitany et al. (2013) given by
\begin{array}{ll}
&\displaystyle
f (x) = a \lambda x^{-2} \exp \left(-\frac {\lambda}{x} \right)
\left[ 1 - \exp \left( -\frac {\lambda}{x} \right) \right]^{a - 1},
\\
&\displaystyle
F (x) = 1 - \left[ 1 - \exp \left( -\frac {\lambda}{x} \right) \right]^a,
\\
&\displaystyle
{\rm VaR}_p (X) = \lambda \left\{ -\log \left[ 1 - (1 - p)^{1 / a} \right] \right\}^{-1},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\lambda}{p} \int_0^p \left\{ -\log \left[ 1 - (1 - v)^{1 / a} \right] \right\}^{-1} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter and \lambda > 0
, the scale parameter.
Usage
dinvexpexp(x, lambda=1, a=1, log=FALSE)
pinvexpexp(x, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
varinvexpexp(p, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
esinvexpexp(p, lambda=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dinvexpexp(x)
pinvexpexp(x)
varinvexpexp(x)
esinvexpexp(x)
Inverse gamma distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the inverse gamma distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {b^a \exp (-b / x)}{x^{a + 1} \Gamma (a)},
\\
&\displaystyle
F (x) = Q (a, b / x),
\\
&\displaystyle
{\rm VaR}_p (X) = b \left[ Q^{-1} (a, p) \right]^{-1},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {b}{p} \int_0^p \left[ Q^{-1} (a, v) \right]^{-1} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter, and b > 0
, the scale parameter.
Usage
dinvgamma(x, a=1, b=1, log=FALSE)
pinvgamma(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varinvgamma(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esinvgamma(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dinvgamma(x)
pinvgamma(x)
varinvgamma(x)
esinvgamma(x)
Kumaraswamy distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy distribution due to Kumaraswamy (1980) given by
\begin{array}{ll}
&\displaystyle
f (x) = a b x^{a - 1} \left( 1 - x^a \right)^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left( 1 - x^a \right)^b,
\\
&\displaystyle
{\rm VaR}_p (X) =
\left[ 1 - (1 - p)^{1 / b} \right]^{1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} dv
\end{array}
for 0 < x < 1
, 0 < p < 1
, a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dkum(x, a=1, b=1, log=FALSE)
pkum(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varkum(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
eskum(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkum(x)
pkum(x)
varkum(x)
eskum(x)
Kumaraswamy Burr XII distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy Burr XII distribution due to Parana\'iba et al. (2013) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b k c x^{c - 1}}{\left( 1 + x^c \right)^{k + 1}} \left[ 1 - \left( 1 + x^c \right)^{-k} \right]^{a - 1}
\left\{ 1 - \left[ 1 - \left( 1 + x^c \right)^{-k} \right]^a \right\}^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left\{ 1 - \left[ 1 - \left( 1 + x^c \right)^{-k} \right]^a \right\}^b,
\\
&\displaystyle
{\rm VaR}_p (X) = \left[ \left\{ 1 - \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right\}^{-1 / k} - 1 \right]^{1/c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \left[ \left\{ 1 - \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right\}^{-1 / k} - 1 \right]^{1/c} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter,
c > 0
, the third shape parameter, and k > 0
, the fourth shape parameter.
Usage
dkumburr7(x, a=1, b=1, k=1, c=1, log=FALSE)
pkumburr7(x, a=1, b=1, k=1, c=1, log.p=FALSE, lower.tail=TRUE)
varkumburr7(p, a=1, b=1, k=1, c=1, log.p=FALSE, lower.tail=TRUE)
eskumburr7(p, a=1, b=1, k=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
c |
the value of the third shape parameter, must be positive, the default is 1 |
k |
the value of the fourth shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumburr7(x)
pkumburr7(x)
varkumburr7(x)
eskumburr7(x)
Kumaraswamy exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy exponential distribution due to Cordeiro and de Castro (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = a b \lambda \exp (-\lambda x) \left[ 1 - \exp (-\lambda x) \right]^{a - 1}
\left\{ 1 - \left[ 1 - \exp (-\lambda x) \right]^a \right\}^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left\{ 1 - \left[ 1 - \exp (-\lambda x) \right]^a \right\}^b,
\\
&\displaystyle
{\rm VaR}_p (X) = -\frac {1}{\lambda} \log \left\{ 1 - \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right\},
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {1}{p \lambda} \int_0^p \log \left\{ 1 - \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right\} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter, and \lambda > 0
, the scale parameter.
Usage
dkumexp(x, lambda=1, a=1, b=1, log=FALSE)
pkumexp(x, lambda=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varkumexp(p, lambda=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
eskumexp(p, lambda=1, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumexp(x)
pkumexp(x)
varkumexp(x)
eskumexp(x)
Kumaraswamy gamma distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy gamma distribution due to de Pascoa et al. (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = c d b^a x^{a - 1} \exp (-b x)
\frac {\gamma^{c - 1} (a, b x)}{\Gamma^c (a)}
\left[ 1 - \frac {\gamma^c (a, b x)}{\Gamma^c (a)} \right]^{d - 1},
\\
&\displaystyle
F (x) = 1 - \left[ 1 - \frac {\gamma^c (a, b x)}{\Gamma^c (a)} \right]^d,
\\
&\displaystyle
{\rm VaR}_p (X) =
\frac {1}{b} Q^{-1} \left( a, 1 - \left[ 1 - (1 - p)^{1 / d} \right]^{1 / c} \right),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{b p} \int_0^p Q^{-1} \left( a, 1 - \left[ 1 - (1 - v)^{1 / d} \right]^{1 / c} \right) dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the scale parameter,
c > 0
, the second shape parameter, and d > 0
, the third shape parameter.
Usage
dkumgamma(x, a=1, b=1, c=1, d=1, log=FALSE)
pkumgamma(x, a=1, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
varkumgamma(p, a=1, b=1, c=1, d=1, log.p=FALSE, lower.tail=TRUE)
eskumgamma(p, a=1, b=1, c=1, d=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
c |
the value of the second shape parameter, must be positive, the default is 1 |
d |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumgamma(x)
pkumgamma(x)
varkumgamma(x)
eskumgamma(x)
Kumaraswamy Gumbel distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy Gumbel distribution due to Cordeiro et al. (2012a) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b}{\sigma} \exp \left( \frac {\mu - x}{\sigma} \right)
\exp \left[ -a \exp \left( \frac {\mu - x}{\sigma} \right) \right]
\left\{ 1 - \exp \left[ -a \exp \left( \frac {\mu - x}{\sigma} \right) \right] \right\}^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left\{ 1 - \exp \left[ -a \exp \left( \frac {\mu - x}{\sigma} \right) \right] \right\}^b,
\\
&\displaystyle
{\rm VaR}_p (X) = \mu - \sigma \log \left\{ -\log \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right\},
\\
&\displaystyle
{\rm ES}_p (X) = \mu - \frac {\sigma}{p} \int_0^p \log \left\{ -\log \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right\} dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dkumgumbel(x, a=1, b=1, mu=0, sigma=1, log=FALSE)
pkumgumbel(x, a=1, b=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varkumgumbel(p, a=1, b=1, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
eskumgumbel(p, a=1, b=1, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumgumbel(x)
pkumgumbel(x)
varkumgumbel(x)
eskumgumbel(x)
Kumaraswamy half normal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy half normal distribution due to Cordeiro et al. (2012c) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {2a b}{\sigma} \phi \left( \frac {x}{\sigma} \right) \left[ 2 \Phi \left( \frac {x}{\sigma} \right) - 1 \right]^{a - 1}
\left\{ 1 - \left[ 2 \Phi \left( \frac {x}{\sigma} \right) - 1 \right]^a \right\}^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left\{ 1 - \left[ 2 \Phi \left( \frac {x}{\sigma} \right) - 1 \right]^a \right\}^b,
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \Phi^{-1} \left( \frac {1}{2} + \frac {1}{2}
\left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right),
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \Phi^{-1} \left( \frac {1}{2} + \frac {1}{2}
\left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right) dv
\end{array}
for x > 0
, 0 < p < 1
,
\sigma > 0
, the scale parameter, a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dkumhalfnorm(x, sigma=1, a=1, b=1, log=FALSE)
pkumhalfnorm(x, sigma=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varkumhalfnorm(p, sigma=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
eskumhalfnorm(p, sigma=1, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumhalfnorm(x)
pkumhalfnorm(x)
varkumhalfnorm(x)
eskumhalfnorm(x)
Kumaraswamy log-logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy log-logistic distribution due to de Santana et al. (2012) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b \beta \alpha^\beta x^{a \beta - 1}}
{\left( \alpha^\beta + x^\beta \right)^{a + 1}}
\left[ 1 - \frac {x^{a \beta}}{\left( \alpha^\beta + x^\beta \right)^a} \right]^{b - 1},
\\
&\displaystyle
F (x) = \left[ 1 - \frac {x^{a \beta}}{\left( \alpha^\beta + x^\beta \right)^a} \right]^b,
\\
&\displaystyle
{\rm VaR}_p (X) = \alpha \left\{ \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} - 1 \right\}^{-1 / \beta},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\alpha}{p} \int_0^p \left\{ \left[ 1 - (1 - v)^{1 / b}
\right]^{1 / a} - 1 \right\}^{-1 / \beta} dv
\end{array}
for x > 0
, 0 < p < 1
, \alpha > 0
, the scale parameter, \beta > 0
, the first shape parameter,
a > 0
, the second shape parameter, and b > 0
, the third shape parameter.
Usage
dkumloglogis(x, a=1, b=1, alpha=1, beta=1, log=FALSE)
pkumloglogis(x, a=1, b=1, alpha=1, beta=1, log.p=FALSE, lower.tail=TRUE)
varkumloglogis(p, a=1, b=1, alpha=1, beta=1, log.p=FALSE, lower.tail=TRUE)
eskumloglogis(p, a=1, b=1, alpha=1, beta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
alpha |
the value of the scale parameter, must be positive, the default is 1 |
beta |
the value of the first shape parameter, must be positive, the default is 1 |
a |
the value of the second shape parameter, must be positive, the default is 1 |
b |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumloglogis(x)
pkumloglogis(x)
varkumloglogis(x)
eskumloglogis(x)
Kumaraswamy normal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for Kumaraswamy normal distribution due to Cordeiro and de Castro (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b}{\sigma} \phi \left( \frac {x - \mu}{\sigma} \right) \Phi^{a - 1} \left( \frac {x - \mu}{\sigma} \right)
\left[ 1 - \Phi^a \left( \frac {x - \mu}{\sigma} \right) \right]^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left[ 1 - \Phi^a \left( \frac {x - \mu}{\sigma} \right) \right]^b,
\\
&\displaystyle
{\rm VaR}_p (X) = \mu + \sigma \Phi^{-1} \left( \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right),
\\
&\displaystyle
{\rm ES}_p (X) = \mu + \frac {\sigma}{p} \int_0^p \Phi^{-1} \left( \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, \sigma > 0
, the scale parameter,
a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dkumnormal(x, mu=0, sigma=1, a=1, b=1, log=FALSE)
pkumnormal(x, mu=0, sigma=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varkumnormal(p, mu=0, sigma=1, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
eskumnormal(p, mu=0, sigma=1, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumnormal(x)
pkumnormal(x)
varkumnormal(x)
eskumnormal(x)
Kumaraswamy Pareto distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy Pareto distribution due to Pereira et al. (2013) given by
\begin{array}{ll}
&\displaystyle
f (x) = a b c K^c x^{-c - 1}
\left[ 1 - \left( \frac {K}{x} \right)^c \right]^{a - 1}
\left\{ 1 - \left[ 1 - \left( \frac {K}{x} \right)^c \right]^a \right\}^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left\{ 1 - \left[ 1 - \left( \frac {K}{x} \right)^c \right]^a \right\}^b,
\\
&\displaystyle
{\rm VaR}_p (X) = K \left\{ 1 - \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right\}^{-1 / c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {K}{p} \int_0^p \left\{ 1 - \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right\}^{-1 / c} dv
\end{array}
for x \geq K
, 0 < p < 1
, K > 0
, the scale parameter, c > 0
, the first shape parameter,
a > 0
, the second shape parameter, and b > 0
, the third shape parameter.
Usage
dkumpareto(x, K=1, a=1, b=1, c=1, log=FALSE)
pkumpareto(x, K=1, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
varkumpareto(p, K=1, a=1, b=1, c=1, log.p=FALSE, lower.tail=TRUE)
eskumpareto(p, K=1, a=1, b=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
K |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
c |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumpareto(x)
pkumpareto(x)
varkumpareto(x)
eskumpareto(x)
Kumaraswamy Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Kumaraswamy Weibull distribution due to Cordeiro et al. (2010) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a b \alpha x^{\alpha - 1}}{\sigma^\alpha}
\exp \left[ -\left( \frac {x}{\sigma} \right)^{\alpha} \right]
\left\{ 1 - \exp \left[ -\left( \frac {x}{\sigma} \right)^{\alpha} \right] \right\}^{a - 1}
\left[ 1 - \left\{ 1 - \exp \left[ -\left( \frac {x}{\sigma} \right)^{\alpha} \right] \right\}^a \right]^{b - 1},
\\
&\displaystyle
F (x) = 1 - \left[ 1 - \left\{ 1 - \exp \left[ -\left( \frac {x}{\sigma} \right)^{\alpha} \right] \right\}^a \right]^b,
\\
&\displaystyle
{\rm VaR}_p (X) =
\sigma \left[ -\log \left\{ 1 - \left[ 1 - (1 - p)^{1 / b} \right]^{1 / a} \right\} \right]^{1 / \alpha},
\\
&\displaystyle
{\rm ES}_p (X) =
\frac {\sigma}{p} \int_0^p \left[ -\log \left\{ 1 - \left[ 1 - (1 - v)^{1 / b} \right]^{1 / a} \right\} \right]^{1 / \alpha} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter, \alpha > 0
, the third shape parameter, and \sigma > 0
, the scale parameter.
Usage
dkumweibull(x, a=1, b=1, alpha=1, sigma=1, log=FALSE)
pkumweibull(x, a=1, b=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varkumweibull(p, a=1, b=1, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
eskumweibull(p, a=1, b=1, alpha=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
alpha |
the value of the third shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dkumweibull(x)
pkumweibull(x)
varkumweibull(x)
eskumweibull(x)
Laplace distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Laplace distribution due to due to Laplace (1774) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{2 \sigma} \exp \left( -\frac {\mid x - \mu \mid}{\sigma} \right),
\\
&\displaystyle
F (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2} \exp \left( \frac {x - \mu}{\sigma} \right), & \mbox{if $x < \mu$,}
\\
\\
\displaystyle
1 - \frac {1}{2} \exp \left( -\frac {x - \mu}{\sigma} \right), & \mbox{if $x \geq \mu$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\mu + \sigma \log (2 p), & \mbox{if $p < 1/2$,}
\\
\\
\displaystyle
\mu - \sigma \log \left[ 2 (1 - p) \right], & \mbox{if $p \geq 1/2$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\mu + \sigma \left[ \log (2 p) - 1 \right], & \mbox{if $p < 1/2$,}
\\
\\
\displaystyle
\mu + \sigma - \frac {\sigma}{p} + \sigma \frac {1 - p}{p} \log (1 - p) +\sigma \frac {1 - p}{p} \log 2, & \mbox{if $p \geq 1/2$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and
\sigma > 0
, the scale parameter.
Usage
dlaplace(x, mu=0, sigma=1, log=FALSE)
plaplace(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varlaplace(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
eslaplace(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlaplace(x)
plaplace(x)
varlaplace(x)
eslaplace(x)
Linear failure rate distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the linear failure rate distribution due to Bain (1974) given by
\begin{array}{ll}
&\displaystyle
f(x) = (a + b x) \exp \left( -a x - b x^2 / 2 \right),
\\
&\displaystyle
F (x) = 1 - \exp \left( -a x - b x^2 / 2 \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {-a + \sqrt{a^2 - 2 b \log (1 - p)}}{b},
\\
&\displaystyle
{\rm ES}_p (X) = -\frac {a}{b} + \frac {1}{b p} \int_0^p \sqrt{a^2 - 2 b \log (1 - v)} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first scale parameter, and b > 0
, the second scale parameter.
Usage
dlfr(x, a=1, b=1, log=FALSE)
plfr(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varlfr(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
eslfr(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlfr(x)
plfr(x)
varlfr(x)
eslfr(x)
Log beta distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the log beta distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {(\log d - \log c)^{1 - a - b}}{x B (a, b)}
(\log x - \log c)^{a - 1} (\log d - \log x)^{b - 1},
\\
&\displaystyle
F (x) = I_{\frac {\log x - \log c}{\log d - \log c}} (a, b),
\\
&\displaystyle
{\rm VaR}_p (X) = c \left( \frac {d}{c} \right)^{I_p^{-1} (a, b)},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {c}{p} \int_0^p \left( \frac {d}{c} \right)^{I_v^{-1} (a, b)} dv
\end{array}
for 0 < c \leq x \leq d
, 0 < p < 1
, a > 0
, the first shape parameter, b > 0
, the second shape parameter, c > 0
, the first location parameter, and d > 0
, the second location parameter.
Usage
dlogbeta(x, a=1, b=1, c=1, d=2, log=FALSE)
plogbeta(x, a=1, b=1, c=1, d=2, log.p=FALSE, lower.tail=TRUE)
varlogbeta(p, a=1, b=1, c=1, d=2, log.p=FALSE, lower.tail=TRUE)
eslogbeta(p, a=1, b=1, c=1, d=2)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
c |
the value of the first location parameter, must be positive, the default is 1 |
d |
the value of the second location parameter, must be positive and greater than c, the default is 2 |
a |
the value of the first scale parameter, must be positive, the default is 1 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlogbeta(x)
plogbeta(x)
varlogbeta(x)
eslogbeta(x)
Log Cauchy distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the log Cauchy distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{x \pi} \frac {\sigma}{(\log x - \mu)^2 + \sigma^2},
\\
&\displaystyle
F (x) = \frac {1}{\pi} \arctan \left( \frac {\log x - \mu}{\sigma} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \exp \left[ \mu + \sigma \tan \left( \pi p \right) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\exp (\mu)}{p} \int_0^p \exp \left[ \sigma \tan \left( \pi v \right) \right] dv
\end{array}
for x > 0
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and
\sigma > 0
, the scale parameter.
Usage
dlogcauchy(x, mu=0, sigma=1, log=FALSE)
plogcauchy(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varlogcauchy(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
eslogcauchy(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlogcauchy(x)
plogcauchy(x)
varlogcauchy(x)
eslogcauchy(x)
Log gamma distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the log gamma distribution due to Consul and Jain (1971) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a^r x^{a - 1} (-\log x)^{r - 1}}{\Gamma (r)},
\\
&\displaystyle
F (x) = Q (r, -a \log x),
\\
&\displaystyle
{\rm VaR}_p (X) = \exp \left[ -\frac {1}{a} Q^{-1} (r, p) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p} \int_0^p \exp
\left[ -\frac {1}{a} Q^{-1} (r, v) \right] dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first shape parameter, and r > 0
, the second shape parameter.
Usage
dloggamma(x, a=1, r=1, log=FALSE)
ploggamma(x, a=1, r=1, log.p=FALSE, lower.tail=TRUE)
varloggamma(p, a=1, r=1, log.p=FALSE, lower.tail=TRUE)
esloggamma(p, a=1, r=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
r |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dloggamma(x)
ploggamma(x)
varloggamma(x)
esloggamma(x)
Logistic exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the logistic exponential distribution due to Lan and Leemis (2008) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\displaystyle a \lambda \exp (\lambda x)
\left[ \exp (\lambda x) - 1 \right]^{a - 1}}
{\displaystyle \left\{ 1 + \left[ \exp (\lambda x) - 1 \right]^a \right\}^2},
\\
&\displaystyle
F (x) = \frac {\displaystyle \left[ \exp (\lambda x) - 1 \right]^a}
{\displaystyle 1 + \left[ \exp (\lambda x) - 1 \right]^a},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{\lambda} \log \left[ 1 + \left( \frac {p}{1 - p} \right)^{1 / a} \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p \lambda} \int_0^p \log \left[ 1 + \left( \frac {v}{1 - v} \right)^{1 / a} \right] dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter and \lambda > 0
, the scale parameter.
Usage
dlogisexp(x, lambda=1, a=1, log=FALSE)
plogisexp(x, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
varlogisexp(p, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
eslogisexp(p, lambda=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlogisexp(x)
plogisexp(x)
varlogisexp(x)
eslogisexp(x)
Logistic Rayleigh distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the logistic Rayleigh distribution due to Lan and Leemis (2008) given by
\begin{array}{ll}
&\displaystyle
f(x) = a \lambda x \exp \left( \lambda x^2 / 2 \right)
\left[ \exp \left( \lambda x^2 / 2 \right) - 1 \right]^{a - 1}
\left\{ 1 + \left[ \exp \left( \lambda x^2 / 2 \right) - 1 \right]^a \right\}^{-2},
\\
&\displaystyle
F(x) = \frac {\left[ \exp \left( \lambda x^2 / 2 \right) - 1 \right]^a}
{1 + \left[ \exp \left( \lambda x^2 / 2 \right) - 1 \right]^a},
\\
&\displaystyle
{\rm VaR}_p (X) = \sqrt{\frac {2}{\lambda}}
\sqrt{\log \left[ 1 + \left( \frac {p}{1 - p} \right)^{1 / a} \right]},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sqrt{2}}{p \sqrt{\lambda}}
\int_0^p \left\{ \log \left[ 1 + \left( \frac {v}{1 - v} \right)^{1 / a} \right] \right\}^{1/2} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter, and \lambda > 0
, the scale parameter.
Usage
dlogisrayleigh(x, a=1, lambda=1, log=FALSE)
plogisrayleigh(x, a=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varlogisrayleigh(p, a=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
eslogisrayleigh(p, a=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlogisrayleigh(x)
plogisrayleigh(x)
varlogisrayleigh(x)
eslogisrayleigh(x)
Logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the logistic distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma} \exp \left( -\frac {x - \mu}{\sigma} \right)
\left[ 1 + \exp \left( -\frac {x - \mu}{\sigma} \right) \right]^{-2},
\\
&\displaystyle
F (x) = \frac {1}{1 + \exp \left( -\frac {x - \mu}{\sigma} \right)},
\\
&\displaystyle
{\rm VaR}_p (X) = \mu + \sigma \log \left[ p (1 - p) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \mu - 2 \sigma + \sigma \log p - \sigma \frac {1 - p}{p} \log (1 - p)
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and \sigma > 0
, the scale parameter.
Usage
dlogistic(x, mu=0, sigma=1, log=FALSE)
plogistic(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varlogistic(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
eslogistic(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlogistic(x)
plogistic(x)
varlogistic(x)
eslogistic(x)
Log Laplace distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the log Laplace distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {a b x^{b - 1}}{\delta^b (a + b)}, & \mbox{if $x \leq \delta$,}
\\
\\
\displaystyle
\frac {a b \delta^a}{x^{a + 1} (a + b)}, & \mbox{if $x > \delta$,}
\end{array}
\right.
\\
&\displaystyle
F (x) = \left\{
\begin{array}{ll}
\displaystyle
\frac {a x^b}{\delta^b (a + b)}, & \mbox{if $x \leq \delta$,}
\\
\\
\displaystyle
1 - \frac {b \delta^a}{x^a (a + b)}, & \mbox{if $x > \delta$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
\delta \left[ p \frac {a + b}{a} \right]^{1/b}, & \mbox{if $p \leq \frac {a}{a + b}$,}
\\
\\
\displaystyle
\delta \left[ (1 - p) \frac {a + b}{a} \right]^{-1/a}, & \mbox{if $p > \frac {a}{a + b}$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\frac {\delta b}{b + 1}
\left[ p \frac {a + b}{a} \right]^{1/b}, & \mbox{if $p \leq \frac {a}{a + b}$,}
\\
\\
\displaystyle
\frac {a \delta}{p (1 + 1/b) (a + b)} +
\frac {a^{1/a} b^{1 - 1/a} \delta}{p (a + b) (1 - 1/a)}
\\
\displaystyle
\quad
-\frac {\delta (1 - p)}{p (1 - 1/a)}
\left[ \frac {a}{(a + b) (1 - p)} \right]^{1/a}, &
\mbox{if $p > \frac {a}{a + b}$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, \delta > 0
, the scale parameter,
a > 0
, the first shape parameter, and b > 0
, the second shape parameter.
Usage
dloglaplace(x, a=1, b=1, delta=0, log=FALSE)
ploglaplace(x, a=1, b=1, delta=0, log.p=FALSE, lower.tail=TRUE)
varloglaplace(p, a=1, b=1, delta=0, log.p=FALSE, lower.tail=TRUE)
esloglaplace(p, a=1, b=1, delta=0)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
delta |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the first shape parameter, must be positive, the default is 1 |
b |
the value of the second shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dloglaplace(x)
ploglaplace(x)
varloglaplace(x)
esloglaplace(x)
Loglog distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Loglog distribution due to Pham (2002) given by
\begin{array}{ll}
&\displaystyle
f(x) = a \log (\lambda) x^{a - 1}
\lambda^{x^a} \exp \left[ 1 - \lambda^{x^a} \right],
\\
&\displaystyle
F (x) = 1 - \exp \left[ 1 - \lambda^{x^a} \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \frac {\log \left[ 1 - \log (1 - p) \right]}{\log \lambda} \right\}^{1/a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{p (\log \lambda)^{1/a}}
\int_0^p \left\{ \log \left[ 1 - \log (1 - v) \right] \right\}^{1/a} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter, and \lambda > 1
, the scale parameter.
Usage
dloglog(x, a=1, lambda=2, log=FALSE)
ploglog(x, a=1, lambda=2, log.p=FALSE, lower.tail=TRUE)
varloglog(p, a=1, lambda=2, log.p=FALSE, lower.tail=TRUE)
esloglog(p, a=1, lambda=2)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be greater than 1, the default is 2 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dloglog(x)
ploglog(x)
varloglog(x)
esloglog(x)
Log-logistic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the log-logistic distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {b a^b x^{b - 1}}
{\left( a^b + x^b \right)^2},
\\
&\displaystyle
F (x) = \frac {x^b}{a^b + x^b},
\\
&\displaystyle
{\rm VaR}_p (X) = a \left( \frac {p}{1 - p} \right)^{1 / b},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {a}{p} B_p \left( 1 + \frac {1}{b}, 1 - \frac {1}{b} \right)
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the scale parameter, and b > 0
, the shape parameter,
where B_x (a, b) = \int_0^x t^{a - 1} (1 - t)^{b - 1} dt
denotes the incomplete beta function.
Usage
dloglogis(x, a=1, b=1, log=FALSE)
ploglogis(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varloglogis(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esloglogis(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the scale parameter, must be positive, the default is 1 |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dloglogis(x)
ploglogis(x)
varloglogis(x)
esloglogis(x)
Lognormal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the lognormal distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma x} \phi \left( \frac {\log x - \mu}{\sigma} \right),
\\
&\displaystyle
F (x) = \Phi \left( \frac {\log x - \mu}{\sigma} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \exp \left[ \mu + \sigma \Phi^{-1} (p) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\exp (\mu)}{p} \int_0^p \exp \left[ \sigma \Phi^{-1} (v) \right] dv
\end{array}
for x > 0
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and \sigma > 0
, the scale parameter.
Usage
dlognorm(x, mu=0, sigma=1, log=FALSE)
plognorm(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varlognorm(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
eslognorm(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlognorm(x)
plognorm(x)
varlognorm(x)
eslognorm(x)
Lomax distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Lomax distribution due to Lomax (1954) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {a}{\lambda} \left( 1 + \frac {x}{\lambda} \right)^{-a - 1},
\\
&\displaystyle
F (x) = 1 - \left( 1 + \frac {x}{\lambda} \right)^{-a},
\\
&\displaystyle
{\rm VaR}_p (X) = \lambda \left[ (1 - p)^{-1 / a} - 1 \right],
\\
&\displaystyle
{\rm ES}_p (X) = -\lambda + \frac {\lambda - \lambda (1 - p)^{1 - 1 / a}}{p - p / a}
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the shape parameter, and \lambda > 0
, the scale parameter.
Usage
dlomax(x, a=1, lambda=1, log=FALSE)
plomax(x, a=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varlomax(p, a=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
eslomax(p, a=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dlomax(x)
plomax(x)
varlomax(x)
eslomax(x)
Marshall-Olkin exponential distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Marshall-Olkin exponential distribution due to Marshall and Olkin (1997) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\displaystyle \lambda \exp (\lambda x)}
{\displaystyle \left[ \exp (\lambda x) - 1 + a \right]^2},
\\
&\displaystyle
F (x) = \frac {\displaystyle \exp (\lambda x) - 2 + a}{\displaystyle \exp (\lambda x) - 1 + a},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{\lambda} \log \frac {2 - a - (1 - a) p}{1 - p},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{\lambda} \log
\left[ 2 - a - (1 - a) p \right] - \frac {2 - a}{\lambda (1 - a) p}
\log \frac {2 - a - (1 - a) p}{2 - a} + \frac {1 - p}{\lambda p} \log (1 - p)
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first scale parameter and \lambda > 0
, the second scale parameter.
Usage
dmoexp(x, lambda=1, a=1, log=FALSE)
pmoexp(x, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
varmoexp(p, lambda=1, a=1, log.p=FALSE, lower.tail=TRUE)
esmoexp(p, lambda=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
lambda |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dmoexp(x)
pmoexp(x)
varmoexp(x)
esmoexp(x)
Marshall-Olkin Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Marshall-Olkin Weibull distribution due to Marshall and Olkin (1997) given by
\begin{array}{ll}
&\displaystyle
f(x) = b \lambda^b x^{b - 1} \exp \left[ (\lambda x)^b \right]
\left\{ \exp \left[ (\lambda x)^b \right] - 1 + a \right\}^{-2},
\\
&\displaystyle
F(x) = \frac {\displaystyle \exp \left[ (\lambda x)^b \right] - 2 + a}
{\displaystyle \exp \left[ (\lambda x)^b \right] - 1 + a},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{\lambda} \left[ \log \left( \frac {1}{1 - p} + 1 - a \right) \right]^{1 / b},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {1}{\lambda p} \int_0^p \left[ \log \left( \frac {1}{1 - v} + 1 - a \right) \right]^{1 / b} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first scale parameter, b > 0
, the shape parameter,
and \lambda > 0
, the second scale parameter.
Usage
dmoweibull(x, a=1, b=1, lambda=1, log=FALSE)
pmoweibull(x, a=1, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varmoweibull(p, a=1, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
esmoweibull(p, a=1, b=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
lambda |
the value of the second scale parameter, must be positive, the default is 1 |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dmoweibull(x)
pmoweibull(x)
varmoweibull(x)
esmoweibull(x)
Nakagami distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Nakagami distribution due to Nakagami (1960) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {2 m^m}{\Gamma (m) a^m} x^{2 m - 1}
\exp \left( -\frac {m x^2}{a} \right),
\\
&\displaystyle
F (x) = 1 - Q \left( m, \frac {m x^2}{a} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \sqrt{\frac {a}{m}} \sqrt{Q^{-1} (m, 1 - p)},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sqrt{a}}{p \sqrt{m}} \int_0^p \sqrt{Q^{-1} (m, 1 - v)} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the scale parameter, and m > 0
, the shape parameter.
Usage
dnakagami(x, m=1, a=1, log=FALSE)
pnakagami(x, m=1, a=1, log.p=FALSE, lower.tail=TRUE)
varnakagami(p, m=1, a=1, log.p=FALSE, lower.tail=TRUE)
esnakagami(p, m=1, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the scale parameter, must be positive, the default is 1 |
m |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dnakagami(x)
pnakagami(x)
varnakagami(x)
esnakagami(x)
Normal distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the normal distribution due to de Moivre (1738) and Gauss (1809) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\sigma} \phi \left( \frac {x - \mu}{\sigma} \right),
\\
&\displaystyle
F (x) = \Phi \left( \frac {x - \mu}{\sigma} \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \mu + \sigma \Phi^{-1} (p),
\\
&\displaystyle
{\rm ES}_p (X) = \mu + \frac {\sigma}{p} \int_0^p \Phi^{-1} (v) dv
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \mu < \infty
, the location parameter, and \sigma > 0
, the scale parameter,
where \phi (\cdot)
denotes the pdf of a standard normal random variable,
and \Phi (\cdot)
denotes the cdf of a standard normal random variable.
Usage
dnormal(x, mu=0, sigma=1, log=FALSE)
pnormal(x, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
varnormal(p, mu=0, sigma=1, log.p=FALSE, lower.tail=TRUE)
esnormal(p, mu=0, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
mu |
the value of the location parameter, can take any real value, the default is zero |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dnormal(x)
pnormal(x)
varnormal(x)
esnormal(x)
Pareto distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Pareto distribution due to Pareto (1964) given by
\begin{array}{ll}
&\displaystyle
f (x) = c K^c x^{-c - 1},
\\
&\displaystyle
F (x) = 1 - \left( \frac {K}{x} \right)^c,
\\
&\displaystyle
{\rm VaR}_p (X) = K (1 - p)^{-1 / c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {K c}{p (1 - c)} (1 - p)^{1 - 1 / c} - \frac {K c}{p (1 - c)}
\end{array}
for x \geq K
, 0 < p < 1
, K > 0
, the scale parameter, and c > 0
, the shape parameter.
Usage
dpareto(x, K=1, c=1, log=FALSE)
ppareto(x, K=1, c=1, log.p=FALSE, lower.tail=TRUE)
varpareto(p, K=1, c=1, log.p=FALSE, lower.tail=TRUE)
espareto(p, K=1, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
K |
the value of the scale parameter, must be positive, the default is 1 |
c |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dpareto(x)
ppareto(x)
varpareto(x)
espareto(x)
Pareto positive stable distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Pareto positive stable distribution due to Sarabia and Prieto (2009) and Guillen et al. (2011) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\nu \lambda}{x}
\left[ \log \left( \frac {x}{\sigma} \right) \right]^{\nu - 1}
\exp \left\{ -\lambda \left[ \log \left( \frac {x}{\sigma} \right) \right]^\nu \right\},
\\
&\displaystyle
F (x) = 1 - \exp \left\{ -\lambda \left[ \log \left( \frac {x}{\sigma} \right) \right]^\nu \right\},
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \exp \left\{ \left[ -\frac {1}{\lambda} \log (1 - p) \right]^{1/\nu} \right\},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \int_0^p \exp \left\{ \left[ -\frac {1}{\lambda} \log (1 - v) \right]^{1/\nu} \right\} dv
\end{array}
for x > 0
, 0 < p < 1
, \lambda > 0
, the first scale parameter, \sigma > 0
, the second scale parameter, and \nu > 0
, the shape parameter.
Usage
dparetostable(x, lambda=1, nu=1, sigma=1, log=FALSE)
pparetostable(x, lambda=1, nu=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varparetostable(p, lambda=1, nu=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
esparetostable(p, lambda=1, nu=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
lambda |
the value of the first scale parameter, must be positive, the default is 1 |
sigma |
the value of the second scale parameter, must be positive, the default is 1 |
nu |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dparetostable(x)
pparetostable(x)
varparetostable(x)
esparetostable(x)
Perks distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Perks distribution due to Perks (1932) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {\displaystyle a \exp (b x) \left[ 1 + a \right]}
{\displaystyle \left[ 1 + a \exp (b x) \right]^2},
\\
&\displaystyle
F (x) = 1 - \frac {\displaystyle 1 + a}
{\displaystyle 1 + a \exp (b x)},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {1}{b} \log \frac {a + p}{a (1 - p)},
\\
&\displaystyle
{\rm ES}_p (X) = -\left( 1 + \frac {a}{p} \right) \frac {\log a}{b}
+\frac {(a + p) \log (a +p)}{b p}
+ \frac {(1 - p) \log (1 - p)}{b p}
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first scale parameter and b > 0
, the second scale parameter.
Usage
dperks(x, a=1, b=1, log=FALSE)
pperks(x, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
varperks(p, a=1, b=1, log.p=FALSE, lower.tail=TRUE)
esperks(p, a=1, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
b |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dperks(x)
pperks(x)
varperks(x)
esperks(x)
Power function I distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the power function I distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = a x^{a - 1},
\\
&\displaystyle
F (x) = x^a,
\\
&\displaystyle
{\rm VaR}_p (X) = p^{1 / a},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {p^{1 / a}}{1 / a + 1}
\end{array}
for 0 < x < 1
, 0 < p < 1
, and a > 0
, the shape parameter.
Usage
dpower1(x, a=1, log=FALSE)
ppower1(x, a=1, log.p=FALSE, lower.tail=TRUE)
varpower1(p, a=1, log.p=FALSE, lower.tail=TRUE)
espower1(p, a=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dpower1(x)
ppower1(x)
varpower1(x)
espower1(x)
Power function II distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the power function II distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = b (1 - x)^{b - 1},
\\
&\displaystyle
F (x) = 1 - (1 - x)^b,
\\
&\displaystyle
{\rm VaR}_p (X) = 1 - (1 - p)^{1 / b},
\\
&\displaystyle
{\rm ES}_p (X) = 1 + \frac {b \left[ (1 - p)^{1 / b + 1} - 1 \right]}{p (b + 1)}
\end{array}
for 0 < x < 1
, 0 < p < 1
, and b > 0
, the shape parameter.
Usage
dpower2(x, b=1, log=FALSE)
ppower2(x, b=1, log.p=FALSE, lower.tail=TRUE)
varpower2(p, b=1, log.p=FALSE, lower.tail=TRUE)
espower2(p, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dpower2(x)
ppower2(x)
varpower2(x)
espower2(x)
Quadratic distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the quadratic distribution given by
\begin{array}{ll}
&\displaystyle
f(x) = \alpha (x - \beta)^2,
\\
&\displaystyle
F(x) = \frac {\alpha}{3} \left[ (x - \beta)^3 + (\beta - a)^3 \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \beta + \left[ \frac {3 p}{\alpha} - (\beta - a)^3 \right]^{1/3},
\\
&\displaystyle
{\rm ES}_p (X) = \beta + \frac {\alpha}{4 p} \left\{ \left[ \frac {3 p}{\alpha} - (\beta - a)^3 \right]^{4/3} - (\beta - a)^4 \right\}
\end{array}
for a \leq x \leq b
, 0 < p < 1
, -\infty < a < \infty
, the first location parameter, and -\infty < a < b < \infty
, the second location parameter, where \alpha = \frac {12}{(b - a)^3}
and \beta = \frac {a + b}{2}
.
Usage
dquad(x, a=0, b=1, log=FALSE)
pquad(x, a=0, b=1, log.p=FALSE, lower.tail=TRUE)
varquad(p, a=0, b=1, log.p=FALSE, lower.tail=TRUE)
esquad(p, a=0, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first location parameter, can take any real value, the default is zero |
b |
the value of the second location parameter, can take any real value but must be greater than a, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dquad(x)
pquad(x)
varquad(x)
esquad(x)
Reflected gamma distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the reflected gamma distribution due to Borgi (1965) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{\displaystyle 2 \phi \Gamma \left( a \right)}
\left | \frac {x - \theta}{\phi} \right |^{a - 1}
\exp \left\{ -\left | \frac {x - \theta}{\phi} \right | \right\},
\\
&\displaystyle
F (x) =
\left\{
\begin{array}{ll}
\displaystyle
\frac {1}{2} Q \left( a, \frac {\theta - x}{\phi} \right), &
\mbox{if $x \leq \theta$,}
\\
\\
\displaystyle
1 - \frac {1}{2} Q \left( a, \frac {x - \theta}{\phi} \right), &
\mbox{if $x > \theta$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\theta - \phi Q^{-1} \left( a, 2 p \right), &
\mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\theta + \phi Q^{-1} \left( a, 2 (1 - p) \right), &
\mbox{if $p > 1/2$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
\theta - \frac {\phi}{p} \int_0^p Q^{-1} \left( a, 2 v \right) dv, &
\mbox{if $p \leq 1/2$,}
\\
\\
\displaystyle
\theta - \frac {\phi}{p} \int_0^{1/2} Q^{-1} \left( a, 2 v \right) dv +\frac {\phi}{p} \int_{1/2}^p Q^{-1}
\left( a, 2 (1 - v) \right) dv, & \mbox{if $p > 1/2$}
\end{array}
\right.
\end{array}
for -\infty < x < \infty
, 0 < p < 1
, -\infty < \theta < \infty
, the location parameter,
\phi > 0
, the scale parameter, and a > 0
, the shape parameter.
Usage
drgamma(x, a=1, theta=0, phi=1, log=FALSE)
prgamma(x, a=1, theta=0, phi=1, log.p=FALSE, lower.tail=TRUE)
varrgamma(p, a=1, theta=0, phi=1, log.p=FALSE, lower.tail=TRUE)
esrgamma(p, a=1, theta=0, phi=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, can take any real value, the default is zero |
phi |
the value of the scale parameter, must be positive, the default is 1 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
drgamma(x)
prgamma(x)
varrgamma(x)
esrgamma(x)
Schabe distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Schabe distribution due to Schabe (1994) given by
\begin{array}{ll}
&\displaystyle
f(x) = \frac {\displaystyle 2 \gamma + (1 - \gamma) x / \theta}{\displaystyle \theta (\gamma + x/\theta)^2},
\\
&\displaystyle
F(x) = \frac {\displaystyle (1 + \gamma) x}{\displaystyle x + \gamma \theta},
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {p \gamma \theta}{1 + \gamma - p},
\\
&\displaystyle
{\rm ES}_p (X) = -\theta \gamma - \frac {\theta \gamma (1 + \gamma)}{p}
\log \frac {1 + \gamma - p}{1 + \gamma}
\end{array}
for x > 0
, 0 < p < 1
, 0 < \gamma < 1
, the first scale parameter, and \theta > 0
, the second scale parameter.
Usage
dschabe(x, gamma=0.5, theta=1, log=FALSE)
pschabe(x, gamma=0.5, theta=1, log.p=FALSE, lower.tail=TRUE)
varschabe(p, gamma=0.5, theta=1, log.p=FALSE, lower.tail=TRUE)
esschabe(p, gamma=0.5, theta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
gamma |
the value of the first scale parameter, must be in the unit interval, the default is 0.5 |
theta |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dschabe(x)
pschabe(x)
varschabe(x)
esschabe(x)
Hyperbolic secant distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the hyperbolic secant distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{2} {\rm sech} \left( \frac {\pi x}{2} \right),
\\
&\displaystyle
F (x) = \frac {2}{\pi} \arctan \left[ \exp \left( \frac {\pi x}{2} \right) \right],
\\
&\displaystyle
{\rm VaR}_p (X) = \frac {2}{\pi} \log \left[ \tan \left( \frac {\pi p}{2} \right) \right],
\\
&\displaystyle
{\rm ES}_p (X) = \frac {2}{\pi p} \int_0^p \log \left[ \tan \left( \frac {\pi v}{2} \right) \right] dv
\end{array}
for -\infty < x < \infty
, and 0 < p < 1
.
Usage
dsecant(x, log=FALSE)
psecant(x, log.p=FALSE, lower.tail=TRUE)
varsecant(p, log.p=FALSE, lower.tail=TRUE)
essecant(p)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dsecant(x)
psecant(x)
varsecant(x)
essecant(x)
Stacy distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for Stacy distribution due to Stacy (1962) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {c x^{c \gamma - 1} \exp \left[ -(x / \theta)^c \right]}{\theta^{c \gamma} \Gamma (\gamma)},
\\
&\displaystyle
F (x) = 1 - Q \left( \gamma, \left( \frac {x}{\theta} \right)^c \right),
\\
&\displaystyle
{\rm VaR}_p (X) = \theta \left[ Q^{-1} (\gamma, 1 - p) \right]^{1 / c},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\theta}{p} \int_0^p \left[ Q^{-1} (\gamma, 1 - v) \right]^{1 / c} dv
\end{array}
for x > 0
, 0 < p < 1
, \theta > 0
, the scale parameter, c > 0
, the first shape parameter, and
\gamma > 0
, the second shape parameter.
Usage
dstacygamma(x, gamma=1, c=1, theta=1, log=FALSE)
pstacygamma(x, gamma=1, c=1, theta=1, log.p=FALSE, lower.tail=TRUE)
varstacygamma(p, gamma=1, c=1, theta=1, log.p=FALSE, lower.tail=TRUE)
esstacygamma(p, gamma=1, c=1, theta=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the scale parameter, must be positive, the default is 1 |
c |
the value of the first scale parameter, must be positive, the default is 1 |
gamma |
the value of the second scale parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dstacygamma(x)
pstacygamma(x)
varstacygamma(x)
esstacygamma(x)
Triangular distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the triangular distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \left\{
\begin{array}{ll}
\displaystyle
0, & \mbox{if $x < a$,}
\\
\\
\displaystyle
\frac {2 (x - a)}{(b - a) (c - a)}, & \mbox{if $a \leq x \leq c$,}
\\
\\
\displaystyle
\frac {2 (b - x)}{(b - a) (b - c)}, & \mbox{if $c < x \leq b$,}
\\
\\
\displaystyle
0, & \mbox{if $b < x$,}
\end{array} \right.
\\
&\displaystyle
F (x) = \left\{
\begin{array}{ll}
\displaystyle
0, & \mbox{if $x < a$,}
\\
\\
\displaystyle
\frac {(x - a)^2}{(b - a) (c - a)}, & \mbox{if $a \leq x \leq c$,}
\\
\\
\displaystyle
1 - \frac {(b - x)^2}{(b - a) (b - c)}, & \mbox{if $c < x \leq b$,}
\\
\\
\displaystyle
1, & \mbox{if $b < x$,}
\end{array} \right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{
\begin{array}{ll}
\displaystyle
a + \sqrt{p (b - a) (c - a)}, & \mbox{if $0 < p < \frac {c - a}{b - a}$,}
\\
\\
\displaystyle
b - \sqrt{(1 - p) (b - a) (b - c)}, & \mbox{if $\frac {c - a}{b - a} \leq p < 1$,}
\end{array} \right.
\\
&\displaystyle
{\rm ES}_p (X) =
\left\{
\begin{array}{ll}
\displaystyle
a + \frac {2}{3} \sqrt{p (b - a) (c - a)}, & \mbox{if $0 < p < \frac {c - a}{b - a}$,}
\\
\\
\displaystyle
b + \frac {a - c}{p} + \frac {2 (2 c - a - b)}{3 p} +2 \sqrt{(b - a) (b - c)} \frac {(1 - p)^{3/2}}{3 p}, &
\mbox{if $\frac {c - a}{b - a} \leq p < 1$}
\end{array} \right.
\end{array}
for a \leq x \leq b
, 0 < p < 1
, -\infty < a < \infty
, the first location parameter, -\infty < a < c < \infty
, the second location parameter, and -\infty < c < b < \infty
, the third location parameter.
Usage
dtriangular(x, a=0, b=2, c=1, log=FALSE)
ptriangular(x, a=0, b=2, c=1, log.p=FALSE, lower.tail=TRUE)
vartriangular(p, a=0, b=2, c=1, log.p=FALSE, lower.tail=TRUE)
estriangular(p, a=0, b=2, c=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first location parameter, can take any real value, the default is zero |
c |
the value of the second location parameter, can take any real value but must be greater than a, the default is 1 |
b |
the value of the third location parameter, can take any real value but must be greater than c, the default is 2 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dtriangular(x)
ptriangular(x)
vartriangular(x)
estriangular(x)
Two sided power distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the two sided power distribution due to van Dorp and Kotz (2002) given by
\begin{array}{ll}
&\displaystyle
f (x) = \left\{ \begin{array}{ll}
\displaystyle
a \left( \frac {x}{\theta} \right)^{a - 1}, & \mbox{if $0 < x \leq \theta$,}
\\
\displaystyle
a \left( \frac {1 - x}{1 - \theta} \right)^{a - 1}, & \mbox{if $\theta < x < 1$,}
\end{array}
\right.
\\
&\displaystyle
F (x) = \left\{ \begin{array}{ll}
\displaystyle
\theta \left( \frac {x}{\theta} \right)^a, & \mbox{if $0 < x \leq \theta$,}
\\
\displaystyle
1 - (1 - \theta) \left( \frac {1 - x}{1 - \theta} \right)^a, & \mbox{if $\theta < x < 1$,}
\end{array}
\right.
\\
&\displaystyle
{\rm VaR}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
\theta \left( \frac {p}{\theta} \right)^{1 / a}, & \mbox{if $0 < p \leq \theta$,}
\\
\displaystyle
1 - (1 - \theta) \left( \frac {1 - p}{1 - \theta} \right)^{1 / a}, & \mbox{if $\theta < p < 1$,}
\end{array}
\right.
\\
&\displaystyle
{\rm ES}_p (X) = \left\{ \begin{array}{ll}
\displaystyle
\frac {a \theta}{a + 1} \left( \frac {p}{\theta} \right)^{1 / a}, & \mbox{if $0 < p \leq \theta$,}
\\
\displaystyle
1 - \frac {\theta}{p} + \frac {a (2 \theta - 1)}{(a + 1) p} + \frac {a (1 - \theta)^2}{(a + 1) p}
\left( \frac {1 - p}{1 - \theta} \right)^{1 + 1 / a}, & \mbox{if $\theta < p < 1$}
\end{array}
\right.
\end{array}
for 0 < x < 1
, 0 < p < 1
, a > 0
, the shape parameter, and -\infty < \theta < \infty
, the location parameter.
Usage
dtsp(x, a=1, theta=0.5, log=FALSE)
ptsp(x, a=1, theta=0.5, log.p=FALSE, lower.tail=TRUE)
vartsp(p, a=1, theta=0.5, log.p=FALSE, lower.tail=TRUE)
estsp(p, a=1, theta=0.5)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
theta |
the value of the location parameter, must take a value in the unit interval, the default is 0.5 |
a |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dtsp(x)
ptsp(x)
vartsp(x)
estsp(x)
Uniform distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the uniform distribution given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {1}{b - a},
\\
&\displaystyle
F (x) = \frac {x - a}{b - a},
\\
&\displaystyle
{\rm VaR}_p (X) = a + p (b - a),
\\
&\displaystyle
{\rm ES}_p (X) = a + \frac {p}{2} (b - a)
\end{array}
for a < x < b
, 0 < p < 1
, -\infty < a < \infty
, the first location parameter, and -\infty < a < b < \infty
, the second location parameter.
Usage
duniform(x, a=0, b=1, log=FALSE)
puniform(x, a=0, b=1, log.p=FALSE, lower.tail=TRUE)
varuniform(p, a=0, b=1, log.p=FALSE, lower.tail=TRUE)
esuniform(p, a=0, b=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first location parameter, can take any real value, the default is zero |
b |
the value of the second location parameter, can take any real value but must be greater than a, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
duniform(x)
puniform(x)
varuniform(x)
esuniform(x)
Weibull distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Weibull distribution due to Weibull (1951) given by
\begin{array}{ll}
&\displaystyle
f (x) = \frac {\alpha x^{\alpha - 1}}{\sigma^\alpha}
\exp \left\{ -\left( \frac {x}{\sigma} \right)^{\alpha} \right\},
\\
&\displaystyle
F (x) = 1 - \exp \left\{ -\left( \frac {x}{\sigma} \right)^{\alpha} \right\},
\\
&\displaystyle
{\rm VaR}_p (X) = \sigma \left[ -\log (1 - p) \right]^{1 / \alpha},
\\
&\displaystyle
{\rm ES}_p (X) = \frac {\sigma}{p} \gamma \left( 1 + 1 / \alpha, - \log (1 - p) \right)
\end{array}
for x > 0
, 0 < p < 1
, \alpha > 0
, the shape parameter, and \sigma > 0
, the scale parameter.
Usage
dWeibull(x, alpha=1, sigma=1, log=FALSE)
pWeibull(x, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
varWeibull(p, alpha=1, sigma=1, log.p=FALSE, lower.tail=TRUE)
esWeibull(p, alpha=1, sigma=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
sigma |
the value of the scale parameter, must be positive, the default is 1 |
alpha |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dWeibull(x)
pWeibull(x)
varWeibull(x)
esWeibull(x)
Xie distribution
Description
Computes the pdf, cdf, value at risk and expected shortfall for the Xie distribution due to Xie et al. (2002) given by
\begin{array}{ll}
&\displaystyle
f(x) = \lambda b \left( \frac {x}{a} \right)^{b - 1}
\exp \left[ (x/a)^b \right] \exp \left( \lambda a \right)
\exp \left\{ -\lambda a \exp \left[ (x/a)^b \right] \right\},
\\
&\displaystyle
F (x) =
1 - \exp \left( \lambda a \right)
\exp \left\{ -\lambda a \exp \left[ (x/a)^b \right] \right\},
\\
&\displaystyle
{\rm VaR}_p (X) =
a \left\{ \log \left[ 1 - \frac {\log (1 - p)}{\lambda a} \right] \right\}^{1/b},
\\
&\displaystyle
{\rm ES}_p (X) =
\frac {a}{p} \int_0^p \left\{ \log \left[ 1 - \frac {\log (1 - v)}{\lambda a} \right] \right\}^{1/b} dv
\end{array}
for x > 0
, 0 < p < 1
, a > 0
, the first scale parameter, b > 0
, the shape parameter,
and \lambda > 0
, the second scale parameter.
Usage
dxie(x, a=1, b=1, lambda=1, log=FALSE)
pxie(x, a=1, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
varxie(p, a=1, b=1, lambda=1, log.p=FALSE, lower.tail=TRUE)
esxie(p, a=1, b=1, lambda=1)
Arguments
x |
scaler or vector of values at which the pdf or cdf needs to be computed |
p |
scaler or vector of values at which the value at risk or expected shortfall needs to be computed |
a |
the value of the first scale parameter, must be positive, the default is 1 |
lambda |
the value of the second scale parameter, must be positive, the default is 1 |
b |
the value of the shape parameter, must be positive, the default is 1 |
log |
if TRUE then log(pdf) are returned |
log.p |
if TRUE then log(cdf) are returned and quantiles are computed for exp(p) |
lower.tail |
if FALSE then 1-cdf are returned and quantiles are computed for 1-p |
Value
An object of the same length as x
, giving the pdf or cdf values computed at x
or an object of the same length as p
, giving the values at risk or expected shortfall computed at p
.
Author(s)
Saralees Nadarajah
References
Stephen Chan, Saralees Nadarajah & Emmanuel Afuecheta (2016). An R Package for Value at Risk and Expected Shortfall, Communications in Statistics - Simulation and Computation, 45:9, 3416-3434, doi:10.1080/03610918.2014.944658
Examples
x=runif(10,min=0,max=1)
dxie(x)
pxie(x)
varxie(x)
esxie(x)