I have two main questions. 1. Why does my best fit not match the actual? THe best fit based on AIC and BIC is AR1 the model is ARMA(2,1)
Here are my formulas
set.seed(170)
x <- arima.sim(model = list(ar = c(0.2, -0.1), ma = 0.1), n = 230)
ts.plot(x)
acf2(x)
Here is the coding used for to find AIC and BIC for question 1.
AR1_fit <- sarima(x, p=1, d=0, q=0)
AR1_fit
AR2_fit <- sarima(x, p=2, d=0, q=0)
AR2_fit
MA1_fit <- sarima(x, p=0, d=0, q=1)
MA1_fit
MA2_fit <- sarima(x, p=0, d=0, q=2)
MA2_fit
ARMA11_fit <- sarima(x, p=1, d=0, q=1)
ARMA11_fit
ARMA12_fit <- sarima(x, p=1, d=0, q=2)
ARMA12_fit
ARMA21_fit <- sarima(x, p=2, d=0, q=1)
ARMA21_fit
ARMA22_fit <- sarima(x, p=2, d=0, q=2)
ARMA22_fit
The simple reason is the random component. You fitted an ARMA(2,1) model but due to the random variable in every step, it is possible that this random factor ensure that the ARMA(2,1) model looks like an ARMA(1,1) model. This can happen and in another seed the AIC and BIC might select an ARIMA (1,2) as the best model fit and even the acf and pacf could look like the model is an ARMA(1,2). This is just due to the error term. Try to repeat your code 1000 different times with different seeds and you will see that in most cases the AIC and BIC will choose an ARMA(2,1) and the acf and pacf look like ARMA(2,1) too. Hope it answers both questions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.