我正在使用quantmod包下载一些股票的每日收盘数据:
library(quantmod)
library(dygraphs)
library(forecast)
date <- as.Date("2014-11-01")
getSymbols("SBIN.BO",from = date )
close <- SBIN.BO[, 4]
dygraph(close)
dat <- data.frame(date = index(SBIN.BO),SBIN.BO)
acf1 <- acf(close)
当我尝试从预测包中执行自动arima功能时:
fit <- auto.arima(close, seasonal=FALSE, xreg=fourier(close, K=4))
我遇到以下错误:
Error in ...fourier(x, K, 1:length(x)) :
K must be not be greater than period/2
所以我想知道为什么会出现这个错误?我在编写代码时是否犯了任何错误,这些代码基于Rob的网站/博客上提供的教程......