9
$\begingroup$

In these days I'm working with Breusch-Pagan to test homoscedasticity.

I've tested the prices of two stocks with this method. This is the result:

> mod <- lm(prices[,1] ~ prices[,2])
> bp <- bptest(mod)
> bp

    studentized Breusch-Pagan test

data:  prices[, 1] ~ prices[, 2] 
BP = 0.032, df = 1, p-value = 0.858

Reading the result the series should be homoscedastic, but if I plot the residuals and the squares residuals it seems totally not! Take a look below:

enter image description here

the Residuals Vs FItted below:

enter image description here

How is it possible this series pass the test with a very high p-value?

$\endgroup$
2
  • 2
    $\begingroup$ BP test requires that variables on the right hand side should be exogenous. Since you have two prices, they may influence each other. Another feature of the prices is that they are usually unit-root processes, that is usually a no-no in simple regression tests. I should check these two things before investigating further. $\endgroup$
    – mpiktas
    Commented Sep 13, 2011 at 12:12
  • $\begingroup$ @Mpiktas, The series you see above has not unit root.I checked it using PP test and KPSS test. How can i change the formula in this case?do i have to use another test instead of BP? $\endgroup$
    – Dail
    Commented Sep 13, 2011 at 13:16

1 Answer 1

9
$\begingroup$

The problem isn't heteroskedasticity, that's why it's passing the test. The problem is that your model doesn't work well for (at least some of) your observations.

I've never seen anyone analyze stock prices without looking at their differences. Try a Dickey-Fuller test for a unit root---I bet that you can't reject that there is one, as @mpiktas alludes to in his comment.

If there isn't a unit root, perhaps there is a time trend or seasonality. You might try including a linear time trend or seasonal components.

Alternatively, you might try working with the log of the prices, which sometimes helps the fit.

$\endgroup$
7
  • $\begingroup$ I have replied to mpiktas, before Breusch-Pagan I check the series with: Phillips-Perron and KPSS unit root tests. Unfortunately, the series pass these tests. I also check the cointegration with Johansen and the series pass again(cointegrated). What could I do? $\endgroup$
    – Dail
    Commented Sep 13, 2011 at 14:06
  • $\begingroup$ Your data do not reject the null in the KPSS and do reject the null in the Phillips-Perron test? As I said, BP is telling you that heteroskedasticity isn't a problem here, so you don't need to correct for it. The pattern of your residuals suggests that there may be some kind of time trend lurking around if there isn't a unit root; I added that part to my answer. Don't worry about heteroskedasiticy (you pass BP), worry about your model. Suggestions to remove spikes in residuals: Try incorporating time trends or seasonality; try using logs of prices instead. $\endgroup$
    – Charlie
    Commented Sep 13, 2011 at 15:07
  • $\begingroup$ If you really worry about heteroskedasticity for some reason, even though BP says that you don't need to and your plots suggest that your model needs to be tweaked instead, you can use robust standard errors. $\endgroup$
    – Charlie
    Commented Sep 13, 2011 at 15:08
  • $\begingroup$ the PP reject the null and KPSS can't reject the null. So the series should not have unit root and should be stationary...and also johansen procedure tell me that the series are cointegrated. My problem is not to correct it, I only what to delete the pair (stockA - stockB) that don't have constant variance. BP test is saying that the data is homoscedastic but is not. So what is the method that i can use to understand if this "variance" is constant for real ? $\endgroup$
    – Dail
    Commented Sep 13, 2011 at 15:20
  • $\begingroup$ as you surely understand I need to do the linear regression to know the coefficient, EVERY stock of A how many stocks of B I need to have? If i remove spikes, or doing any other change I cant get fixed coefficients. $\endgroup$
    – Dail
    Commented Sep 13, 2011 at 15:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.