[R] Cross correlation between two time series over nested time periods?
timlee126 at yahoo.com
Thu May 14 02:11:50 CEST 2015
Dear R users,
I have two time series
Calculate and plot cross correlation between two time series over nested time periods. Each point in either time series is for a week (not exactly a calendar week, but the first week in a calendar year always starts from Jan 1, and the other weeks in the same year follow that, and the last week of the year may contain more than 7 days but no more than 13 days).
The first time series A is stored in a compressed (.gz) text file, which looks like (each week and the corresponding time series value are separated by a comma in a line):
The second time series B is similarly stored in a compressed (.gz) text file, but over a subset of period of A, which looks like:
I wonder how to calculate the cross correlation between the two time series A and B (up to a specified maximum lag), and plot A and B in a single plot?
Thanks and regards,
More information about the R-help