# Heteroscedastic test does not solve the problem

As my previous questions I'm trying to solve a problem with my stocks tests. I tried Breusch-Pagan test for heteroscedasticity but some residuals still pass these tests.

My procedure is:

• Get two stocks prices (I have a matrix with two columns that represent the price lists)

• I do a linear regression, like: lm(prices[,1] ~ prices[,2])

• Then I test the residuals of the linear regression with Unit Root tests (PP and KPSS)

• After these tests I do Breusch-Pagan test because I only need to work with stocks that have constant variance during all the period. I do: bptest(prices[,1] ~ prices[,2])

Ok, now I still get strange results, with strange i mean that when i plot the residuals i see that the variance is not constant (take a look at the chart below). So now, I need to understand how better test is the variance is constant.

I read someone use GARCH (1,1) but I never used it, could someone exmplain it or maybe give me other tests to try?

• This is not a new question. If you wanted to add the part about to GARCH, you should edit your original question, which will bump it back up in the list. Plus, what happened to the approach that we came up with in chat? – Charlie Sep 15 '11 at 14:02
• i'm in chat @Charlie, if you came I will explain the problem – Dail Sep 15 '11 at 14:41
• Your problem is far worse than non-constant variance: obviously the means of the residuals vary strongly with the 'index'. GARCH will not be the cure! – whuber Sep 15 '11 at 16:30

I recommended taking first differences of each variable and regressing one on the other. This gets around the spurious causation problem. In this regression, the residuals did not have any autocorrelation and did not exhibit heterogeneity. A plot of the residuals did not show any temporal patterns. Further, this model has an algebraically identical interpretation as your original one. See that \begin{align*} y_t &= \alpha + \beta x_t + \epsilon_t \\ - y_{t-1} &= -\alpha -\beta x_{t-1} -\epsilon_{t-1} \\ \Delta y_t &= \beta \Delta x_t + \Delta \epsilon_t \end{align*} Technically, this implies that you shouldn't have an intercept term in this regression, but I think that it's generally a good idea to include one (and, in your example, the intercept term is small anyway, so it doesn't matter much).