View source: R/GHAR_1step_rolling.R
GHAR.1step.rolling.VaR.forecast | R Documentation |
This function computes the GHAR model with a rolling window and compute the 1-step-ahead VaR forecasts
GHAR.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 |
are the desidered probability levels 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 GHAR model by Cech and BarunĂk (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
Cech, Frantisek, and Jozef BarunĂk (2017). On the Modelling and Forecasting of Multivariate Realized Volatility: Generalized Heterogeneous Autoregressive (GHAR) Model. Journal of Forecasting 36(2), 181-206.
## 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)
GHAR_roll <- GHAR.1step.rolling.VaR.forecast(cleaned.rc, data_clean$daily_returns,
weights =rep(0.2,5), quantiles = c(0.05, 0.1), roll.window = 250, es.alpha=0.025)
library(xts)
ggplot2::autoplot(as.xts(GHAR_roll), facet = NULL)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.