sim: Simulate Time Series from ARIMA or Transfer Function Models

sim.tfmR Documentation

Simulate Time Series from ARIMA or Transfer Function Models

Description

Generates random time series from ARIMA (um) or transfer function (tfm) models.

Usage

## S3 method for class 'tfm'
sim(
  mdl,
  n = 100,
  z0 = NULL,
  n0 = 0,
  a = NULL,
  seed = NULL,
  envir = parent.frame(),
  ...
)

sim(mdl, ...)

## S3 method for class 'um'
sim(
  mdl,
  n = 100,
  z0 = NULL,
  n0 = 0,
  a = NULL,
  seed = NULL,
  envir = parent.frame(),
  ...
)

Arguments

mdl

An object of class um or tfm.

n

Number of observations to simulate.

z0

Initial conditions for nonstationary series. Default is NULL (zero initial conditions).

n0

Number of initial observations to discard as burn-in. Default is 0.

a

Optional vector of innovations with length n + n0. If NULL, innovations are drawn from N(0, \sigma^2).

seed

Random seed for reproducibility.

envir

Environment for argument evaluation. Default is parent.frame().

...

Additional arguments.

Value

A ts object with the simulated time series.

See Also

sim.um, sim.tfm

Examples

# AR(1) model
mdl1 <- um(ar = "1 - 0.8B", sig2 = 1)
z1 <- sim(mdl1, n = 100, seed = 123)

# ARIMA(0,1,1) with burn-in
mdl2 <- um(i = 1, ma = "1 - 0.5B", sig2 = 1)
z2 <- sim(mdl2, n = 100, n0 = 50, seed = 456)


tfarima documentation built on Nov. 5, 2025, 7:43 p.m.