# Linear regression of time series with heteroskedasticity

I am trying to find if the stock market movements on average and in extreme conditions do affect gold prices. I am following the regression model proposed by Baur and McDermott (2010) which is given as: All models are estimated simultaneously with maximum likelihood methods as mentioned in their published paper which I don’t know how to apply it.

Below is what I have done:

reg <- read.csv(file = "MVreturnsqreg.csv")


The csv file contain time series of gold, S&P500 10 Quantile, S&P500 5 Quantile, S&P500 1 Quantile.

I have used the following regression command in R which I am not sure if it is the correct way to do and whether I can use OLS-regression with time series data. (if not, what is the right type of regression?)

goldregression= lm (reg$gold ~ reg$sp500 + reg$q10sp + reg$q5sp + reg$q1sp)  Below is the output of the regression model, but the estimates at all quantiles are not significant. Also, I don't know how to take heteroskedasticity into consideration? I know GARCH (1,1) can take care of that, but how to estimate it with other models (1,2) at the same time? How can I Incorporate the above OLS-Regression to GARCH-model in order to receive fitted coefficients? or how to fit GARCH (1,1) model in the regression model? I don’t know which way it works. If I use "rugarch" package to model GARCH(1,1), I would only get the parameters regarding the volatility equation ( mu, omega, alpha, beta) but not coefficients of my independent variables. If I have to use GARCH method, where do I find the estimations for my independent variables after using the GARCH? Any Suggestion? • You could do it with rugarch if the coefficient$b_t$did not vary with time. There is a way to specify the conditional mean equation using the option external.regressors inside the mean.model in the ugarchspec function, if I remember correctly. But since$b_t\$ varies with time, you would probably have to write the model's likelihood from scratch and optimize it using a generic optimization function such as optim. Aug 29, 2021 at 15:50
• how to estimate all 3 models simultaneously? Aug 30, 2021 at 17:12
• As I have already said, you would have to write the model's likelihood from scratch and optimize it using a generic optimization function such as optim. Aug 30, 2021 at 18:41

Because of limited data, I would not even try or have faith in developing a sophisticated model here. Fundamentally, I do not feel that given dynamic changing world economies, the introduction of virtual currencies, ..., that a more precise time series model for prediction is possible. However, a crude model may still have some value in my opinion.

So, how to proceed, first build a simple model and extract probabilistic predictions therefrom for investment decision making.

To start, based on an old data series, define what constitutes a significant data shock (as a %) to the stock market. At those observed points, note the corresponding % impact on the price of precious metals (including gold).

From this, based only on old data, develop a simple regression model, for example. The Least-Squares theory provides for the mean prediction, a probability distribution.

Use this distribution to define a discrete probability decision model. Employ the old data to construct the best investment decision model relative to stocks and precious metals.

Re-estimate the simple regression model on more recent data, and apply the best discrete analysis cut-offs, etc, that were previously developed above, for investment decision analysis on the recent data.

Now, you can still continue to pursue a complex model and use my more basic model to confirm or disregard the latter model.

• my concern is how to estimate the 3 models simultaneously. i can't find a way to do that. Aug 30, 2021 at 17:15