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?

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$
3
  • 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-
    Commented Sep 20, 2023 at 20:27
  • $\begingroup$ hi were you able to resolve this issue $\endgroup$ Commented May 18 at 17:56
  • $\begingroup$ I'm also facing a similar problem. Have you resolved it? $\endgroup$
    – ELIO
    Commented Jun 26 at 16:48

0

Your Answer

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