mctCVaRmnts: mctCVaRmnts

Description Usage Arguments References Examples

View source: R/CVaRMultiNTS.R

Description

Calculate the marginal contribution to CVaR for the multivariate NTS market model: the random vector r is

r = μ + diag(σ) X

where

X follows stdNTS_N(α, θ, β, Σ)

Usage

1
mctCVaRmnts(eta, n, w, st)

Arguments

eta

Significant level of CVaR.

n

The targer stock to calculate the mctCVaR

w

The capital allocation rate vector for the current portfolio

st

Structure of parameters for the N-dimensional NTS distribution.

st$ndim : Dimension of the model. Here st$ndim=N.

st$mu : μ mean vector (column vector) of the input data.

st$sigma : σ standard deviation vector (column vector) of the input data.

st$alpha : α of the std NTS distribution (X).

st$theta : θ of the std NTS distribution (X).

st$beta : β vector (column vector) of the std NTS distribution (X).

st$Rho : ρ matrix of the std NTS distribution (X), which is correlation matrix of epsilon.

st$CovMtx : Covariance matrix of return data r.

References

Kim, Y. S. (2020) Portfolio Optimization on the Dispersion Risk and the Asymmetric Tail Risk https://arxiv.org/pdf/2007.13972.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library(functional)
library(nloptr)
library(pracma)
library(spatstat)
library(Matrix)
library(quantmod)
library(mvtnorm)
library("temStaR")

#Fix alpha and theta.
#Estimate alpha dna theta from DJIA and use those parameter for IBM, INTL parameter fit.
getSymbols("^DJI", src="yahoo", from = "2020-8-25", to = "2020-08-31")
prDJ <- as.numeric(DJI$DJI.Adjusted)
ret <- diff(log(prDJ))
ntsparam <-  fitnts(ret)
getSymbols("IBM", src="yahoo", from = "2016-1-1", to = "2020-08-31")
pr1 <- as.numeric(IBM$IBM.Adjusted)
getSymbols("INTL", src="yahoo", from = "2016-1-1", to = "2020-08-31")
pr2 <- as.numeric(INTL$INTL.Adjusted)

returndata <- matrix(data = c(diff(log(pr1)),diff(log(pr2))),
                     ncol = 2, nrow = (length(pr1)-1))
st <- fitmnts( returndata = returndata,
                n = 2,
                alphaNtheta = c(ntsparam["alpha"], ntsparam["theta"])  )
w <- c(0.3, 0.7)
eta <- 0.01

mctVaRmnts(eta, 1, w, st) #MCT-VaR for IBM
mctVaRmnts(eta, 2, w, st) #MCT-VaR for INTL

mctCVaRmnts(eta, 1, w, st) #MCT-CVaR for IBM
mctCVaRmnts(eta, 2, w, st) #MCT-CVaR for INTL

aaron9011/temStaR-v0.814 documentation built on Dec. 24, 2021, 6:16 p.m.