Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

How do I simulate any of the ARIMA Models with Small Sample Size of 10, 15 and 20

$
0
0

How can I use a small number in arima.sim function. In the bellow R codes I simulates two ARIMA models, one having n=10 the other having n=50. After the simulations I used the auto.arima() function from forecast package to check for what the best model for the data simulated.

set.seed(456)
## list description for AR(1) model with small coef
AR.sm <- list(order=c(1,0,0), ar=0.9, sd=0.1)
## list description for AR(1) model with large coef
AR.lg <- list(order=c(1,0,0), ar=0.9, sd=0.1)
## simulate AR(1)
AR1.sm <- arima.sim(n=10, model=AR.sm)
AR1.lg <- arima.sim(n=50, model=AR.lg)
library(forecast)
auto.arima(AR1.sm)
auto.arima(AR1.sm)

How do I make my AR1.sm so that if I check the best model through auto.arima(AR1.sm) and it will give me the orderARIMA(1, 0, 0)and myARparameter will will be close to0.9`.


Viewing all articles
Browse latest Browse all 201867

Trending Articles