金融时间序列分析用R语言画简单收益率和对数收益率的ACF图?!
数据“d-intc7208.txt”为英特尔1972年1月15日到2008年12月31日的日简单收益率,1).画出简单收益率和对数收益率的ACF图,2).并检查简单收益率...
数据“d-intc7208.txt”为英特尔1972年1月15日到2008年12
月31日的日简单收益率,
1). 画出简单收益率和对数收益率的ACF图,
2). 并检查简单收益率和对数收益率的5个和10个的自相关系数是
否为同时0.
我的代码:
int <- read.table("d-intc7208.txt", head=T)
head(int)
int.l <- log(int+1)
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" 展开
月31日的日简单收益率,
1). 画出简单收益率和对数收益率的ACF图,
2). 并检查简单收益率和对数收益率的5个和10个的自相关系数是
否为同时0.
我的代码:
int <- read.table("d-intc7208.txt", head=T)
head(int)
int.l <- log(int+1)
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" 展开
展开全部
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"
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"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询