R为什么在估计ARIMA(1,0,0)和ARIMA(3,0,0)时使用相同数量的观测值
我预计,随着我增加更多的滞后,用于执行估计的观测数量将减少,但情况并非如此。你知道这是怎么回事吗R为什么在估计ARIMA(1,0,0)和ARIMA(3,0,0)时使用相同数量的观测值,r,R,我预计,随着我增加更多的滞后,用于执行估计的观测数量将减少,但情况并非如此。你知道这是怎么回事吗 fit1 <- arima(presidents, c(1, 0, 0)) fit3 <- arima(presidents, c(3, 0, 0)) paste0("length fit1: ", length(fit1$residuals)) paste0("length fit3: ",length(fit3$residuals)) paste0("length presiden
fit1 <- arima(presidents, c(1, 0, 0))
fit3 <- arima(presidents, c(3, 0, 0))
paste0("length fit1: ", length(fit1$residuals))
paste0("length fit3: ",length(fit3$residuals))
paste0("length presidents: ",length(presidents))
# [1] "length fit1: 120"
# [1] "length fit3: 120"
# [1] "length presidents: 120"
fit1为什么观察次数会减少?@Pascal更新了这个问题这是完全不同的算法,不是吗。所以不同的算法,不同的行为。当然,但我不能理解引擎盖下发生了什么。我希望他们也能得出类似的结果。例如,AIC(lm(b[,1]~b[,2]))
,以及AIC(fit1)
为什么观察次数会减少?@Pascal更新了问题这是完全不同的算法,不是吗。所以不同的算法,不同的行为。当然,但我不能理解引擎盖下发生了什么。我希望他们也能得出类似的结果。例如AIC(lm(b[,1]~b[,2])
,和AIC(fit1)
a <- embed(presidents,3)
b <- embed(presidents,2) # setting the data for AR1 estimation
head(b)
paste0("nobs used to estimate AR1 is: ",nrow(b))
# : [,1] [,2]
# : [1,] 87 NA
# : [2,] 82 87
# : [3,] 75 82
# : [4,] 63 75
# : [5,] 50 63
# : [6,] 43 50
# : [1] "nobs used to estimate AR1 is: 119"