预测函数是否用新的预测更新历史(训练)集?
Does the forecast function update the history (training) set with its new predictions?
我正在预测以下 ARMA(1,0,1) 模型:
nrow(Reg_data)
train<-Reg_data[0:(nrow(Reg_data)-7),c(4,5,9)]
test<-Reg_data[(nrow(Reg_data)-6):nrow(Reg_data),4]
View(train)
View(test)
#step 2 get forecast prediction and errors for auto.arima model
attach(train)
mod1<-arima(y,c(1,0,1), include.mean = TRUE)
mod1_results<-forecast(mod1,h=7)
ARMA_Forecasts<-t(t(mod1_results$mean))
此代码似乎有效,但我似乎无法找到(或理解)此函数是否使用其在历史集中的先前预测,即对于预测 h=2 是考虑了 h=1 估计,或者如果我想要这个,我需要写一个滚动 window 循环并多次预测一组 (h=1) 吗?
ARIMA 使用递归预测,因此对于每个新步骤,它使用历史(即训练集)+ 它为上一步生成的预测。
想法如下:使用历史数据构建模型,并使用该模型预测 h=1 的值,然后将该预测反馈回模型以生成 h=2 的预测值,然后然后将其反馈到模型中以生成 h=3,等等……直到达到所需的预测范围。
我正在预测以下 ARMA(1,0,1) 模型:
nrow(Reg_data)
train<-Reg_data[0:(nrow(Reg_data)-7),c(4,5,9)]
test<-Reg_data[(nrow(Reg_data)-6):nrow(Reg_data),4]
View(train)
View(test)
#step 2 get forecast prediction and errors for auto.arima model
attach(train)
mod1<-arima(y,c(1,0,1), include.mean = TRUE)
mod1_results<-forecast(mod1,h=7)
ARMA_Forecasts<-t(t(mod1_results$mean))
此代码似乎有效,但我似乎无法找到(或理解)此函数是否使用其在历史集中的先前预测,即对于预测 h=2 是考虑了 h=1 估计,或者如果我想要这个,我需要写一个滚动 window 循环并多次预测一组 (h=1) 吗?
ARIMA 使用递归预测,因此对于每个新步骤,它使用历史(即训练集)+ 它为上一步生成的预测。
想法如下:使用历史数据构建模型,并使用该模型预测 h=1 的值,然后将该预测反馈回模型以生成 h=2 的预测值,然后然后将其反馈到模型中以生成 h=3,等等……直到达到所需的预测范围。