Simulating multiple, individual ARIMA(p,d,q)+c series, in 1 R program

Hi,

Rather than simulating individual ARIMA(p,d,q)+c series, as individual R programs with specific parameters: gratis, arima.sim, manual loop, or otherwise, how can I generate simulations for a full range of ARIMA(p,d,q)+c models as individual series in 1 R program,

p = 0 to pmax
q = 0 to qmax
d = 0 to dmax

including a constant (or unconditional mean), and no constant, and save EACH series?

Amarjit

The arima_model() function will generate a random ARIMA model. See the help file for how to limit the range of parameters.

library(gratis)
library(tsibble)
# Create 10 ARIMA models at random
models <- purrr::map(seq(10), \(i) arima_model())
# Generate one series from each model
series <- purrr::map2_dfr(models, seq_along(models), \(model, i) { 
  sim <- generate(model, length = 50, n = 1) 
  sim$model <- i
  as_tibble(sim)
}) |> 
  as_tsibble(index = index, key = model)

Created on 2026-05-15 with reprex v2.1.1

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.