在将我的 ARIMA 拟合到数据时,我不断收到错误消息,“数据”必须是矢量类型,为“NULL”。
library(forecast)
foo <- read.csv("https://nofile.io/g/0qrJl41nhf3bQQFjBmM6JurzGJFQSioCTGEzZhWVl9zA1kXnAJsCsSsxN1ZN7F4D/data.csv/")
data <- data.frame(year, Car)
data <- ts(data[,2],start = c(1990,1),frequency = 1)
plot(data)
plot(diff(data),ylab='Differenced Car Usage')
plot(log10(data),ylab='Log (Car Usage)')
plot(diff(log10(data)),ylab='Differenced Log (Tractor Sales)')
par(mfrow = c(1,2))
acf(ts(diff(log10(data))),main='ACF Tractor Sales')
pacf(ts(diff(log10(data))),main='PACF Tractor Sales')
require(forecast)
ARIMAfit <- auto.arima(log10(data), approximation=FALSE,trace=FALSE)
summary(ARIMAfit)
par(mfrow = c(1,1))
pred <- predict(ARIMAfit, n.ahead = 3)
数组(x,c(长度(x),1L)中的错误,如果(!is.null(名称(x)))列表(名称(x),:“数据”必须是向量类型,为“空” '
我只是不明白我做错了什么,如果有人看到这个问题,我将不胜感激。谢谢-MF