Facebook发布了用于预测时间序列的Prophet。虽然入门页面概述了如何使用predict()函数进行预测,但它并没有提到有关评估由prophet进行的时间序列预测的方法,例如检查残差或残差的自相关等等。例如,以下几行将进行预测:
如果我用这种方式计算'acf',结果会让人很沮丧。我的想法正确吗?
library(prophet)
library(dplyr)
library(lubridate)
df <- read.csv('example_wp_peyton_manning.csv') %>% mutate(y = log(y))
df$ds <-ymd(df$ds) # ds is now a Date type
model <- prophet(df) # Create forecasting model
# Make data-frame with future dates for forecasting.
future <- make_future_dataframe(model, periods = 365)
# Make forecasts of these future periods
forecast <- predict(model, future)
# Calculate residuals for common dates
df1<-inner_join(forecast,df, by="ds")
df1$residuals<-df1$y - df1$yhat
# And calculate ACF
acf(df1$residuals,lag.max = 10)
如果我用这种方式计算'acf',结果会让人很沮丧。我的想法正确吗?