# asypower: Asymmetric power distribution In VaRES: Computes value at risk and expected shortfall for over 100 parametric distributions

## 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) = ≤ft\{ \begin{array}{ll} \displaystyle \frac {\displaystyle δ^{1 / λ}}{\displaystyle Γ (1 + 1 / λ)} \exp ≤ft[ -\frac {δ}{a^λ} |x|^λ \right], & \mbox{if $x ≤q 0$}, \\ \\ \displaystyle \frac {\displaystyle δ^{1 / λ}}{\displaystyle Γ (1 + 1 / λ)} \exp ≤ft[ -\frac {δ}{(1 - a)^λ} |x|^λ \right], & \mbox{if \eqn{x > 0},} \end{array} \right. \\ &\displaystyle F (x) = ≤ft\{ \begin{array}{ll} \displaystyle a - a {\cal I} ≤ft( \frac {δ}{a^λ} √{λ} |x|^λ, 1 / λ \right), & \mbox{if $x ≤q 0$,} \\ \\ \displaystyle a - (1 - a) {\cal I} ≤ft( \frac {δ}{(1 - a)^λ} √{λ} |x|^λ, 1 / λ \right), & \mbox{if \eqn{x > 0},} \end{array} \right. \\ &\displaystyle {\rm VaR}_p (X) = ≤ft\{ \begin{array}{ll} \displaystyle -≤ft[ \frac {a^λ}{δ √{λ}} \right]^{1 / λ} ≤ft[ {\cal I}^{-1} ≤ft( 1 - \frac {p}{a}, \frac {1}{λ} \right) \right]^{1 / λ}, & \mbox{if $p ≤q a$,} \\ \\ \displaystyle -≤ft[ \frac {(1 - a)^λ}{δ √{λ}} \right]^{1 / λ} ≤ft[ {\cal I}^{-1} ≤ft( 1 - \frac {1 - p}{1 - a}, \frac {1}{λ} \right) \right]^{1 / λ}, & \mbox{if $p > a$,} \end{array} \right. \\ &\displaystyle {\rm ES}_p (X) = ≤ft\{ \begin{array}{ll} \displaystyle -\frac {1}{p} ≤ft[ \frac {a^λ}{δ √{λ}} \right]^{1 / λ} \int_0^p ≤ft[ {\cal I}^{-1} ≤ft( 1 - \frac {v}{a}, \frac {1}{λ} \right) \right]^{1 / λ} dv, & \mbox{if $p ≤q a$,} \\ \\ \displaystyle -\frac {1}{p} ≤ft[ \frac {a^λ}{δ √{λ}} \right]^{1 / λ} \int_0^a ≤ft[ {\cal I}^{-1} ≤ft( 1 - \frac {v}{a}, \frac {1}{λ} \right) \right]^{1 / λ} dv \\ \quad \displaystyle -\frac {1}{p} ≤ft[ \frac {(1 - a)^λ}{δ √{λ}} \right]^{1 / λ} \int_a^p ≤ft[ {\cal I}^{-1} ≤ft( 1 - \frac {1 - v}{1 - a}, \frac {1}{λ} \right) \right]^{1 / λ} dv, & \mbox{if $p > a$} \end{array} \right. \end{array}

for -∞ < x < ∞, 0 < p < 1, 0 < a < 1, the first scale parameter, δ > 0, the second scale parameter, and λ > 0, the shape parameter, where {\cal I} (x, γ) = \frac {1}{Γ (γ)} \int_0^{x √{γ}} t^{γ - 1} \exp (-t) dt.

## Usage

 1 2 3 4 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)

 1 2 3 4 5 x=runif(10,min=0,max=1) dasypower(x) pasypower(x) varasypower(x) esasypower(x)