VaR.GMMlogreturn: Risk measures from Gaussian mixtures modeling

View source: R/GMM_finance.R

VaR.GMMlogreturnR Documentation

Risk measures from Gaussian mixtures modeling

Description

Value-at-Risk (VaR) and Expected Shortfall (ES) from the fit of Gaussian mixtures provided by GMMlogreturn() function.

Usage

## S3 method for class 'GMMlogreturn'
VaR(object, alpha, ...)

## S3 method for class 'GMMlogreturn'
ES(object, alpha, ...)

Arguments

object

An object of class 'GMMlogreturn'.

alpha

A vector of values in the interval (0,1) for which the risk measures should be calculated.

...

Further arguments passed to or from other methods.

Details

VaR(\alpha) is the maximum potential loss over a specified time horizon with probability equal to the confidence level 1-\alpha.

ES(\alpha) is the expected loss given that the loss exceeds the VaR(\alpha) level.

Value

Returns a numerical value corresponding to VaR or ES at given level(s).

References:

Ruppert Matteson (2015) Statistics and Data Analysis for Financial Engineering, Springer, Chapter 19.

Cizek Hardle Weron (2011) Statistical Tools for Finance and Insurance, 2nd ed., Springer, Chapter 2.

Examples

z = sample(1:2, size = 250, replace = TRUE, prob = c(0.8, 0.2))
y = double(length(z))
y[z == 1] = rnorm(sum(z == 1), 0, 1)
y[z == 2] = rnorm(sum(z == 2), -0.5, 2)
GMM = GMMlogreturn(y)
alpha = seq(0.01, 0.1, by = 0.001)
matplot(alpha, data.frame(VaR = VaR(GMM, alpha),
                          ES = ES(GMM, alpha)),
        type = "l", col = c(2,4), lty = 1, lwd = 2,
        xlab = expression(alpha), ylab = "Loss")
legend("topright", col = c(2,4), lty = 1, lwd = 2,
       legend = c("VaR", "ES"), inset = 0.02)


mclustAddons documentation built on Sept. 20, 2024, 5:06 p.m.