[R] Arima model, breusch godfrey/breusch pagan test

Achim Zeileis Achim.Zeileis at uibk.ac.at
Mon May 28 19:13:22 CEST 2012


On Mon, 28 May 2012, and_mue wrote:

> Hi all
>
> I did an estimation of a simple regression model (ror_xxx~ror_spi_xxx) and
> assessed the quality of this estimation. After having detected that there
> are indications of autocorrelatio and an AR(1) process, I used an arima
> model:
>
> absi.arima=arima(ror_absi, order=c(1,0,0), xreg=ror_spi_absi)
> Output:
>> absi.arima
>
> Call:
> arima(x = ror_absi, order = c(1, 0, 0), xreg = ror_spi_absi)
>
> Coefficients:
>          ar1  intercept  ror_spi_absi
>      -0.5377     -1e-04       -0.0060
> s.e.   0.0752      3e-04        0.0215
>
> sigma^2 estimated as 1.579e-05:  log likelihood = 513.49,  aic = -1018.97
>
> This eliminated the arch effect in my model, but I  want to check weather
> there is still any autocorrelation in my model (with breusch godfrey test,
> bgtest). My question is now on how to implement this in the bgtest function.
> As there has to be typed in the exact equation of the model or a fitted lm
> model, I do not have any idea on what to do now.... Is there a simple
> solution for my problem? Same question would be when using the breusch pagan
> test.

The bgtest() and bptest() functions from package "lmtest" expect a fitted 
"lm" object. To apply them to the residuals of another model you can fit a 
simple constant-only model:

m <- lm(residuals(absi.arima) ~ 1)
bgtest(m)

It would probably be more common to consider Box-type tests as conducted 
by tsdiag(absi.arima).

hth,
Z

> Any suggestions are higly appreciated!
>
> Kind regards,
> Andi
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Arima-model-breusch-godfrey-breusch-pagan-test-tp4631617.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list