Learn R Programming

tseriesTARMA (version 0.5-2)

TARMA.sim: Simulation of a two-regime TARMA(p1,p2,q1,q2) process

Description

Simulates from the following two-regime TARMA(p1,p2,q1,q2) process:

X_t = arrayll _1,0 + _i=1^p_1 _1,i X_t-i + _j=1^q_1 _1,j _t-j + _t, & if X_t-d thd \\\ &\\\ _2,0 + _i=1^p_2 _2,i X_t-i + _j=1^q_2 _2,j _t-j + _t, & if X_t-d > thd array . X[t] = = [1,0] + [1,1]X[t-1] + ... + [1,p1]X[t-p1] + [1,1][t-1] + ... + [1,q][t-q1] + [t] -- if X[t-d] <= thd = [2,0] + [2,1]X[t-1] + ... + [2,p2]X[t-p2] + [2,1][t-1] + ... + [2,q][t-q2] + [t] -- if X[t-d] > thd

Usage

TARMA.sim(
  n,
  phi1,
  phi2,
  theta1,
  theta2,
  d = 1,
  thd = 0,
  s1 = 1,
  s2 = 1,
  rand.gen = rnorm,
  innov = rand.gen(n, ...),
  n.start = 500,
  xstart,
  start.innov = rand.gen(n.start, ...),
  ...
)

Value

A time series object of class ts generated from the above model.

Arguments

n

Length of the series.

phi1

Vector of p1+1 Autoregressive parameters of the lower regime. The first element is the intercept.

phi2

Vector of p2+1 Autoregressive parameters of the upper regime. The first element is the intercept.

theta1

Vector of q1 Moving Average parameters of the lower regime.

theta2

Vector of q2 Moving Average parameters of the upper regime.

d

Delay parameter. Defaults to 1.

thd

Threshold parameter. Defaults to 0.

s1

Innovation variance for the lower regime. Defaults to 1.

s2

Innovation variance for the upper regime. Defaults to 1.

rand.gen

Optional: a function to generate the innovations. Defaults to rnorm.

innov

Optional: a time series of innovations. If not provided, rand.gen is used.

n.start

Length of the burn-in period. Defaults to 500.

xstart

Initial condition as a named list:
$ar: AR part length k = max(p1,p2,d), X[k], X[k-1], ... ,X[1];
$ma: MA part length q = ma.ord, e[q], ... , e[1].

start.innov

Optional: a time series of innovations for the burn-in period.

...

Additional arguments for rand.gen.

Author

Simone Giannerini, simone.giannerini@uniud.it

Greta Goracci, greta.goracci@unibz.it

Details

Note that the parameters are not checked for ergodicity.

References

  • Gia21tseriesTARMA

Examples

Run this code
## a TARMA(1,1,1,1) model
set.seed(123)
x <- TARMA.sim(n=100, phi1=c(0.5,-0.5), phi2=c(0.0,0.8), theta1=-0.5, theta2=0.5, d=1, thd=0.2)

## a TARMA(1,2,1,1) model
x <- TARMA.sim(n=100,phi1=c(0.5,-0.5,0),phi2=c(0,0.5,0.3),theta1=-0.5,theta2=0.5,d=1,thd=0.2)

Run the code above in your browser using DataLab