mctCVaR_MNTS: mctCVaR_MNTS

View source: R/CVaRMultiNTS_old.R View source: R/CVaRMultiNTS.R

mctCVaR_MNTSR Documentation

mctCVaR_MNTS

Description

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

r = \mu + diag(\sigma) X

where

X follows stdNTS_N(\alpha, \theta, \beta, \Sigma)

Usage

mctCVaR_MNTS(eta, n, w, stmnts)

Arguments

n

The targer stock to calculate the mctCVaR

eta

Significant level of CVaR.

w

The capital allocation rate vector for the current portfolio

stmnts

Structure of parameters for the N-dimensional NTS distribution.

CVaRstd

CVaR Value of StdNTS residual. If NULL, the function automatically find it. The default value is NULL

dCVaRstd

The first derivative of the stdNTS CVaR for beta. If NULL, the function automatically find it. The default value is NULL

iCDFstd

The inverst cdf of stdNTS at the significant level eta. If NULL, the function automatically find it. The default value is NULL

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

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

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

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

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

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

st$Rho : \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

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

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


aaron9011/temStaR-v0.90 documentation built on June 1, 2025, 4:15 p.m.