prewhiten | R Documentation |
The bivariate time series are prewhitened according to an AR model fitted to the x-component of the bivariate series. Alternatively, if an ARIMA model is provided, it will be used to prewhiten both series. The CCF of the prewhitened bivariate series is then computed and plotted.
prewhiten(x, y, x.model = ar.res,ylab="CCF", ...)
x |
first component series |
y |
second component series |
x.model |
an ARIMA model; if provided, it is used to prewhiten both series. Otherwise, an AR model is fitted to the x-series and used to prewhiten both series.The AR order is chosen by minimizing the AIC and the fit carried out by the ar.ols function. |
ylab |
label of y-axis; default is "CCF" |
... |
additional parameters to be passed to the ar.ols and the ccf function. |
A list containing the following components:
ccf |
Output from the ccf function on the prewhitened data. |
ar |
The AR model fit to the x-series, or x.model if it is provided. |
Kung-Sik Chan
data(milk) data(electricity) milk.electricity=ts.intersect(milk,log(electricity)) plot(milk.electricity,yax.flip=TRUE,main='') ccf(as.numeric(milk.electricity[,1]),as.numeric(milk.electricity[,2]), main='milk & electricity',ylab='CCF') me.dif=ts.intersect(diff(diff(milk,12)),diff(diff(log(electricity),12))) prewhiten(as.numeric(me.dif[,1]),as.numeric(me.dif[,2]), ,ylab='CCF' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.