data (sales) # Reproduce example 11.7.1, Brockwell and Davis (1991)
sal <- diff (sales)
le <- diff (lead)
k <- daniell.kernel (6)
spectrum (le, k)
spectrum (sal, k)
absolute.coherency (le, sal, k, ylim = range(0,1))
phase.spectrum (le, sal, k)
Run the code above in your browser using DataCamp Workspace