CodexBloom - Programming Q&A Platform

scenarios with `forecast::auto.arima` selecting unexpected models for time series data

👀 Views: 0 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-13
r forecast time-series R

I've been struggling with this for a few days now and could really use some help... I'm using the `forecast` package in R (version 8.15) to automatically select an ARIMA model for my time series data. However, the models it selects seem to have very high AIC values, and I'm not seeing expected results. For instance, when I run the following code: ```R library(forecast) set.seed(123) # Simulating some time series data n <- 100 x <- ts(rnorm(n, mean = 10, sd = 2), frequency = 12) # Using auto.arima to select the best model best_model <- auto.arima(x) summary(best_model) ``` The output shows a model with ARIMA(5,1,0) which has an AIC of 300.5, while I expected something more straightforward like ARIMA(1,1,0) based on the data's apparent trend and seasonality. I've also tried increasing the `stepwise` and `approximation` parameters to FALSE to see if the selection changes, but that didn't help. Additionally, I checked the residuals and they seem to exhibit patterns that suggest the model might not be fitting well. I also ensured that my data is stationary by using the `adf.test()` function from the `tseries` package. Could there be something wrong with how I'm setting up my time series data or any other parameters in `auto.arima` that I may be missing? Has anyone else encountered this? Any help would be greatly appreciated!