Gamma distribution with shape parameter \(\alpha\) and rate parameter \(\beta\).

expValGamma(shape, rate = 1/scale, scale = 1/rate)

varGamma(shape, rate = 1/scale, scale = 1/rate)

kthMomentGamma(k, shape, rate = 1/scale, scale = 1/rate)

expValLimGamma(d, shape, rate = 1/scale, scale = 1/rate)

expValTruncGamma(d, shape, rate = 1/scale, scale = 1/rate, less.than.d = TRUE)

stopLossGamma(d, shape, rate = 1/scale, scale = 1/rate)

meanExcessGamma(d, shape, rate = 1/scale, scale = 1/rate)

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

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

mgfGamma(t, shape, rate = 1/scale, scale = 1/rate)

Arguments

shape

shape parameter \(\alpha\), must be positive.

rate

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

scale

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

k

kth-moment.

d

cut-off value.

less.than.d

logical; if TRUE (default) truncated mean for values <= d, otherwise, for values > d.

kap

probability.

t

t.

Value

Function :

  • expValGamma gives the expected value.

  • varGamma gives the variance.

  • kthMomentGamma gives the kth moment.

  • expValLimGamma gives the limited mean.

  • expValTruncGamma gives the truncated mean.

  • stopLossGamma gives the stop-loss.

  • meanExcessGamma gives the mean excess loss.

  • VatRGamma gives the Value-at-Risk.

  • TVatRGamma gives the Tail Value-at-Risk.

  • mgfGamma gives the moment generating function (MGF).

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

Details

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

Note

Function VatRGamma is a wrapper for the qgamma function stats package.

Examples


# With scale parameter
expValGamma(shape = 3, scale = 4)
#> [1] 12

# With rate parameter
expValGamma(shape = 3, rate = 0.25)
#> [1] 12


# With scale parameter
varGamma(shape = 3, scale = 4)
#> [1] 48

# With rate parameter
varGamma(shape = 3, rate = 0.25)
#> [1] 48


# With scale parameter
kthMomentGamma(k = 2, shape = 3, scale = 4)
#> [1] 192

# With rate parameter
kthMomentGamma(k = 2, shape = 3, rate = 0.25)
#> [1] 192


# With scale parameter
expValLimGamma(d = 2, shape = 3, scale = 4)
#> [1] 1.992244

# With rate parameter
expValLimGamma(d = 2, shape = 3, rate = 0.25)
#> [1] 1.992244


# With scale parameter
expValTruncGamma(d = 2, shape = 3, scale = 4)
#> [1] 0.02101947

# With rate parameter
expValTruncGamma(d = 2, shape = 3, rate = 0.25)
#> [1] 0.02101947

# values greather than d
expValTruncGamma(d = 2, shape = 3, rate = 0.25, less.than.d = FALSE)
#> [1] 11.97898


# With scale parameter
stopLossGamma(d = 2, shape = 3, scale = 4)
#> [1] 10.00776

# With rate parameter
stopLossGamma(d = 2, shape = 3, rate = 0.25)
#> [1] 10.00776


# With scale parameter
meanExcessGamma(d = 2, shape = 3, scale = 4)
#> [1] 74565.87

# With rate parameter
meanExcessGamma(d = 2, shape = 3, rate = 0.25)
#> [1] 74565.87


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

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


# With scale parameter
TVatRGamma(kap = .2, shape = 3, scale = 4)
#> [1] 13.94824

# With rate parameter
TVatRGamma(kap = .2, shape = 3, rate = 0.25)
#> [1] 13.94824


mgfGamma(t = 1, shape = 3, rate = 5)
#> [1] 1.953125