Learn R Programming

PortRisk (version 1.1.0)

risk.attrib.Copula: Risk Attribution of a Portfolio with t-Copula

Description

Combined representation of the risk attributes MCTR, CCTR, Portfolio Volatility, Portfolio Value at Risk (VaR) and individual Volatility of the stocks in a given portfolio for a Markowitz's Optimized weights using t-Copula.

Usage

risk.attrib.Copula(tickers, data, start, end, sim.size=1000, df=10)

Arguments

tickers
A character vector of ticker names of companies in the portfolio.
data
A zoo object whose rownames are dates and colnames are ticker names of the companies. Values of the table corresponds to the daily returns of the stocks of corresponding ticker names.
start
Start date in the format "yyyy-mm-dd".
end
End date in the format "yyyy-mm-dd".
sim.size
Simulation size. Default at 1000.
df
Degrees of freedom for t-Copula. Default set at 10.

Value

Returns a list of following objects:
Volatility
Data frame caontaining Markowitz's optimized weights, individual stock's volatility, MCTR, CCTR for the given tickers.
Portfolio Volatility
Portfolio Volatility
Portfilio VaR
Portfolio Value at Risk

Details

It calculate portfolio Value at Risk after fitting t-Copula with empirical distribution on marginals. It simulate returns from the fitted t-Copula and uses Markowitz's Optimized weight.

See Also

volatility, portvol, mctr, cctr, zoo

Examples

Run this code
# load the data 'SnP500Returns'
data(SnP500Returns)

# consider the portfolio containing the stocks of the companies
# Apple, IBM, Intel, Microsoft
pf <- c("AAPL","IBM","INTC","MSFT")

# risk attribution for the portfolio 'pf' 
# for the time period January 1, 2013 - January 10, 2013
st<-"2013-01-01"
ed<-"2013-10-10"
risk.attrib.Copula(tickers = pf, data = SnP500Returns,
                    start = st, end = ed,
                    sim.size=1000, df=10)

Run the code above in your browser using DataLab