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?
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)