如何用R语言编写等价于ACF的函数

Python018

如何用R语言编写等价于ACF的函数,第1张

方法有很多,给你个例子吧 >m = c(2,3,1,23,4,45,2,31,23,1) >a = acf(m) >a Autocorrelations of series ‘m’, by lag 0 1 2 3 4 5 6 7 8 9 1.000 -0.342 0.352 -0.104 -0.175 -0.111 -0.128 -0.064 0.010 0.064 0到9阶的自相关都有了

acf(int[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int monthly

acf(int.l[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int monthly

log return')

Box.test(int[,2], lag = 5, type = "Ljung-Box")

Box.test(int[,2], lag = 10, type = "Ljung-Box")

Box.test(int.l[,2], lag = 5, type = "Ljung-Box")

Box.test(int.l[,2], lag = 10, type = "Ljung-Box")

运行结果有以下错误,怎么办?

>int <- read.table("d-intc7208.txt", head=T)

错误于file(file, "rt") : 无法打开链结

此外: 警告信息:

In file(file, "rt") :

无法打开文件'd-intc7208.txt': No such file or directory

+ acf(int.l[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int monthly

错误: 意外的符号 in:

"

acf(int.l[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int"

>log return')

错误: 意外的符号 in "log return"

r语言acf-1是二语言中的一个用于坐标的符号。根据查询相关公开信息显示:第二语言(SecondLanguage)指人们在获得第一语言以后再学习和使用的另一种语言。经常作为辅助性语言以及通用语,r语言acf-1是二语言中的一个用于坐标的符号。