Skip to contents

Returns a list output of any n simulations of a user specified ARIMA model. The function returns a list object with two sections:

  • data

  • plots

The data section of the output contains the following:

  • simulation_time_series object (ts format)

  • simulation_time_series_output (mts format)

  • simulations_tbl (simulation_time_series_object in a tibble)

  • simulations_median_value_tbl (contains the stats::median() value of the simulated data)

The plots section of the output contains the following:

  • static_plot The ggplot2 plot

  • plotly_plot The plotly plot


  .n = 100,
  .num_sims = 25,
  .order_p = 0,
  .order_d = 0,
  .order_q = 0,
  .ma = c(),
  .ar = c(),
  .sim_color = "steelblue",
  .alpha = 0.05,
  .size = 1,



The number of points to be simulated.


The number of different simulations to be run.


The p value, the order of the AR term.


The d value, the number of differencing to make the series stationary


The q value, the order of the MA term.


You can list the MA terms respectively if desired.


You can list the AR terms respectively if desired.


The color of the lines for the simulated series.


The alpha component of the ggplot2 and plotly lines.


The size of the median line for the ggplot2


Any other additional arguments for stats::arima.sim


A list object.


This function takes in a user specified arima model. The specification is passed to stats::arima.sim()


Steven P. Sanderson II, MPH


output <- ts_arima_simulator()