[R] prewhiten

Achim Zeileis Achim.Zeileis at uibk.ac.at
Mon Jun 7 13:37:02 CEST 2010


On Mon, 7 Jun 2010, nuncio m wrote:

> HI all.,
> I have some univariate time series that need to be prewhitened. HOw this can
> be performed in R.

That depends on what exactly you want to do for prewhtening. For example, 
if you want to prewhiten using an AR(1) model, you could apply ar() and 
then extract the residuals:
   ar(x, order.max = 1, aic = FALSE, method = ..., demean = ...)$resid
and set the remaining arguments based on your preferences/needs. This can 
also be used for multivariate series.

> I am thinking of to fit an ARIMA model and substract this from the original
> series.

Then you could use the residuals from arima()...

Best,
Z

> Is this the correct way
> THanks in advance
> nuncio
>
> -- 
> Nuncio.M
> Research Scientist
> National Center for Antarctic and Ocean research
> Head land Sada
> Vasco da Gamma
> Goa-403804
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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