GHAR.model: Compute the GHAR model for realized covariances and returns...

View source: R/GHAR.R

GHAR.modelR Documentation

Compute the GHAR model for realized covariances and returns the 1-day-ahead VaR forecasts and the 1-day-ahead Realized Covariance forecast.

Description

This function computes the GHAR model for realized covariances and returns the 1-day ahead VaR forecasts (for an equally-weighted portfolio), as well as the the 1-day-ahead Realized Covariance forecast.

Usage

GHAR.model(cleaned.rc, daily_ret, weights, quantiles = c(0.05, 0.1))

Arguments

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 porfolio VaR

quantiles

the desidered quantiles for the VaR estimates

Details

This function computes the GHAR model for realized covariances by Cech and BarunĂ­k (2017) and returns the 1-day ahead #' VaR forecasts (for an equally-weighted portfolio - default case), the 1-day-ahead Realized Covariance forecast, and the GHAR.fit object computed with the systemfit package

Value

results a list containing the 1-day-ahead VaR forecasts, 1-day-ahead Realized Covariance forecast, and the GHAR.fit object computed with the systemfit package

References

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.

Examples

## 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_fit <- GHAR.model(cleaned.rc, data_clean$daily_returns, weights =rep(0.2,5))

## End(Not run)


deanfantazzini/bitcoinFinance documentation built on June 12, 2024, 4:10 p.m.