Description Usage Arguments Value Author(s) Examples

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.

1 |

`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

1 2 3 4 5 6 7 8 9 | ```
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' )
``` |

```
Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1 2013-03-22
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-17. For overview type 'help("mgcv-package")'.
Loading required package: tseries
Attaching package: 'TSA'
The following objects are masked from 'package:stats':
acf, arima
The following object is masked from 'package:utils':
tar
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.