View source: R/lassovar_1step_rolling.R
lassovar.RC.1step.rolling.VaR.forecast | R Documentation |
This function computes a Lasso-VAR model for realized covariance matrices with a rolling window and computes 1-step-ahead VaR forecasts
lassovar.RC.1step.rolling.VaR.forecast(
cleaned.rc,
daily_ret,
weights,
quantiles = c(0.05, 0.1),
es.alpha = 0.025,
roll.window = 250
)
cleaned.rc |
is a list containing the realized covariances |
daily_ret |
is an xts object containing the cryptocurrency daily returns. It should be compatible with the list containing the realized covariances |
weights |
is a vector of weights for the rolling porfolio VaR forecasts |
quantiles |
the desidered quantiles for the 1-step-ahead VaR estimates |
es.alpha |
is the desidered probability level for the 1-step-ahead ES estimate |
roll.window |
a numerical scalar specifying the dimension of the rolling estimation window |
This function computes the Lasso-VAR model for realized covariance matrices by Callot et al. (2017) with a rolling window and compute the 1-step VaR forecasts
data_to_plot a (zoo object) matrix containing the realized portfolio returns, and the relative 1-day-ahead VaR forecasts
Callot, Laurent AF, Anders B. Kock, and Marcelo C. Medeiros. "Modeling and Forecasting Large Realized Covariance Matrices and Portfolio Choice." Journal of Applied Econometrics 32.1 (2017): 140-158.
## Not run:
library(highfrequency)
localbtcMXN <-bitcoincharts_single_download(name = "localbtcMXN.csv.gz")
btcdeEUR <-bitcoincharts_single_download(name = "btcdeEUR.csv.gz")
krakenEUR <-bitcoincharts_single_download(name = "krakenEUR.csv.gz")
localbtcINR <-bitcoincharts_single_download(name = "localbtcINR.csv.gz")
coinbaseUSD <-bitcoincharts_single_download(name = "coinbaseUSD.csv.gz")
data5<-list(localbtcMXN =localbtcMXN, btcdeEUR=btcdeEUR, krakenEUR=krakenEUR,
localbtcINR=localbtcINR, coinbaseUSD=coinbaseUSD)
data_clean<-aggregate_merge_bictoincharts_data(data_list=data5)
cleaned.rc <- rc_pd(data_clean$price_ts)
lassovar_roll <- lassovar.RC.1step.rolling.VaR.forecast(cleaned.rc, data_clean$daily_returns,
weights =rep(0.2,5), quantiles = c(0.05, 0.1), roll.window = 662, es.alpha=0.025)
library(xts)
ggplot2::autoplot(as.xts(lassovar_roll), facet = NULL)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.