知道一系列收盘价向量X,length=1000,求对数收益率的R语言代码

如题所述

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"
温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-08-15
搜一下:知道一系列收盘价向量X,length=1000,求对数收益率的R语言代码
相似回答