| riskmetrics_mat | R Documentation |
Obtains the matrix H_t, under the RiskMetrics model.
riskmetrics_mat(r_t, lambda = 0.94)
r_t |
List of daily returns |
lambda |
optional Decay parameter. Default to 0.94 |
A list with the H_t matrix, for each t.
# close to close daily log-returns
r_t_s <- diff(log(sp500['2010/2019'][,3]))
r_t_s[1] <- 0
r_t_n <- diff(log(nasdaq['2010/2019'][,3]))
r_t_n[1] <- 0
r_t_f <- diff(log(ftse100['2010/2019'][,3]))
r_t_f[1] <- 0
db_m <- xts::merge.xts(r_t_s, r_t_n, r_t_f)
db_m <- db_m[complete.cases(db_m),]
colnames(db_m) <- c("S&P500", "NASDAQ", "FTSE100")
# list of returns
r_t <- list(db_m[,1], db_m[,2], db_m[,3])
RM <- riskmetrics_mat(r_t)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.