garchmodels icon indicating copy to clipboard operation
garchmodels copied to clipboard

GARCH Models in R with Dummy variables

Open Alex-Sigma opened this issue 2 years ago • 0 comments

Hi everyone

I got the time series Problem.

I want to use multivar. GARCH model with binary predictor, where binary (dummy) variable being calendar feature like January (1 for Yes 0 for no)

Problem: I cannot fit calendar features as dummy variable. Could someone suggest any useful packages with code example.

I tried to do it with garchmodells package.

Below is my code and error message:

DAX_rugarch_01_month <- garch_multivariate_reg( mode = "regression", type = "ugarchspec" ) %>% set_engine("rugarch", specs= list( spec1 = list(mean.model = list(armaOrder = c(1,0))), spec2 = list(mean.model = list(armaOrder = c(1,0))), spec3 = list(mean.model = list(armaOrder = c(1,0))) )) %>% fit(Return~ Date + January, data = DAX_train_January)

Error: multifit GARCH-->error: speclist length not equal to data length

Somethiny is off with my specs at set_engines? The number of dimensions is 3, so I got spec1, spec2, spec3.

Would appreciate any help!

Alex-Sigma avatar Nov 03 '22 17:11 Alex-Sigma