Value-at-Risk of the Erlang distribution with shape parameter \(n\) and rate parameter \(\beta\).

VaR_erlang(kap, shape, rate = 1/scale, scale = 1/rate)

Arguments

kap

probability.

shape

shape parameter \(n\), must be positive integer.

rate

\(\beta\) is the rate parameter, must be positive.

scale

alternative parameterization to rate parameter, scale = 1 / rate.

Value

Function :

Invalid parameter values will return an error detailing which parameter is problematic.

Details

The Erlang distribution with shape parameter \(n\) and rate parameter \(\beta\) has density: $$f\left(x\right) = \frac{\beta^{n}}{\Gamma(n)} x^{n - 1}% \mathrm{e}^{-\beta x}$$ for \(x \in \mathcal{R}^+\), \(\beta > 0\), \(n \in \mathcal{N}^+\)

Note

Wrapper of qgamma from package stats.

See also

Examples

# With scale parameter VaR_erlang(kap = .2, shape = 3, scale = 4)
#> [1] 6.140177
# With rate parameter VaR_erlang(kap = .2, shape = 3, rate = 0.25)
#> [1] 6.140177