Two sided power distribution
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 [REMOVE_ME] \begin{array}{ll}&\displaystylef (x) = \left\{ \begin{array}{ll}\displaystylea \left( \frac {x}{\theta} \right)^{a - 1}, & \mbox{if $0 < x \leq \theta$,}\\\displaystylea \left( \frac {1 - x}{1 - \theta} \right)^{a - 1}, & \mbox{if $\theta < x < 1$,}\end{array}\right.\\&\displaystyleF (x) = \left\{ \begin{array}{ll}\displaystyle\theta \left( \frac {x}{\theta} \right)^a, & \mbox{if $0 < x \leq \theta$,}\\\displaystyle1 - (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$,}\\\displaystyle1 - (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$,}\\\displaystyle1 - \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} [REMOVE_ME_2]
for , , , the shape parameter, and , the location parameter.
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}&\displaystylef (x) = \left\{ \begin{array}{ll}\displaystylea \left( \frac {x}{\theta} \right)^{a - 1}, & \mbox{if $0 < x \leq \theta$,}\\\displaystylea \left( \frac {1 - x}{1 - \theta} \right)^{a - 1}, & \mbox{if $\theta < x < 1$,}\end{array}\right.\\&\displaystyleF (x) = \left\{ \begin{array}{ll}\displaystyle\theta \left( \frac {x}{\theta} \right)^a, & \mbox{if $0 < x \leq \theta$,}\\\displaystyle1 - (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$,}\\\displaystyle1 - (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$,}\\\displaystyle1 - \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 , , , the shape parameter, and , the location parameter.
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)
x
: scaler or vector of values at which the pdf or cdf needs to be computedp
: scaler or vector of values at which the value at risk or expected shortfall needs to be computedtheta
: the value of the location parameter, must take a value in the unit interval, the default is 0.5a
: the value of the shape parameter, must be positive, the default is 1log
: if TRUE then log(pdf) are returnedlog.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-pAn 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
.
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, tools:::Rd_expr_doi("10.1080/03610918.2014.944658")
Saralees Nadarajah
x=runif(10,min=0,max=1) dtsp(x) ptsp(x) vartsp(x) estsp(x)
Useful links