cross-correlation using ccf in R [closed]

非 Y 不嫁゛ 提交于 2019-12-19 11:48:20

问题


I wanted to use ccf in R to compute the cross-correlation on two sets of time-series data. My question is how can I know if any of the correlation coefficients in the plot falls outside the dash blue lines without manually looking at it? Since I have tens of thousands sets of time-series data to deal with. Thanks in advance!


回答1:


Here is the way to calculate the confidence intervals:

res <- ccf(mdeaths, fdeaths, ylab = "cross-correlation")

upperCI <- qnorm((1 + 0.95)/2)/sqrt(res$n.used)
lowerCI <- -qnorm((1 + 0.95)/2)/sqrt(res$n.used)

However, help(plot.acf) warns:

The confidence interval plotted in plot.acf is based on an uncorrelated series and should be treated with appropriate caution. Using ci.type = "ma" may be less potentially misleading.

Look at getAnywhere(plot.acf) to learn how to calculate confidence intervals of type "ma".



来源:https://stackoverflow.com/questions/15551209/cross-correlation-using-ccf-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!