0
$\begingroup$

I'm writing my master thesis in economics, and would like to research the impact of both financial and macroeconomic variables on the S&P500 index. My plan was to use a GARCH model. I've stumbled across the GARCH-MIDAS model which seems perfect, since many macrovariables are only in a monthly format, while the stock return is daily.

I've searched the internet for a R package that can support the model, but all the packages I find are only univariate, while I have several explanatory variables I want to include.

I've looked at the packages mfGARCH, GarchMidas, mcsGARCH, rumidas, rmgarch and midasr (I have attached the packages below), but it seems that none of them both support multiple variables while still estimating GARCH models. Is there something that I have overlooked, or have I simply misunderstand how to use the packages?

https://cran.r-project.org/web/packages/mfGARCH/mfGARCH.pdf

https://github.com/JasonZhang2333/GarchMidas/blob/master/README.md

https://www.unstarched.net/2013/03/20/high-frequency-garch-the-multiplicative-component-garch-mcsgarch-model/

https://www.researchgate.net/publication/344341685_R_Package_%27rumidas%27_Univariate_GARCH-MIDAS_Double-Asymmetric_GARCH-MIDAS_and_MEM-MIDAS

https://cran.r-project.org/web/packages/rmgarch/rmgarch.pdf https://cran.r-project.org/web/packages/midasr/index.html

I tried using the mfGARCH-package, but received an error

#install.package("devtools") 
#install_github("onnokleen/mfGARCH") 
library(devtools) 
library(mfGARCH) 

fit_mfgarch(data = df, y = "PX_CLOSE_1D", x = "RETURN_ON_ASSET", low.freq = "date", K = 12, x.two = "ROC_WACC_RATIO", K.two = 12, low.freq.two = "date", x.three = "VIX_index", K.three = 365, low.freq.three = "date",x.four = "FDFD_index", K.four = 365, low.freq.four = "date", weighting.four = "beta.restricted") 

When I did it with just two variables, I got the error

"Error in fit_mfgarch(data = df, y = "PX_CLOSE_1D", x = "RETURN_ON_ASSET", : There is more than one unique observation per low frequency entry."

However, I use data from 500 stocks, meaning that there have to be overlapping dates.

When testing with four variables as above, it just reported that there was an error (in my dataset I have 40 variables). Do you have suggestions to what I can do differently, or what other packages I can alternatively use?

$\endgroup$
1
  • 1
    $\begingroup$ Two problems with this question. Part of it is a request for a package recommendation which is defined as off-topic on SO. The other part has some code but no clear description or inclusion of sample data. Either of these deficiencies warrants closure. I'm going to pick ht e package request reasoning for my vote but I'm not going to reverse the vote unless you also fix the lack of adequate data description. Close votes can be later reversed if you fix the problems. You should try to build a small dataset that you can test. It should be sufficiently detailed hat it replicates the error. $\endgroup$
    – 42-
    Sep 20 at 20:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.