rar {freqdom}R Documentation

Simulate a multivariate autoregressive time series

Description

Generates a zero mean vector autoregressive process of a given order.

Usage

rar(
  n,
  d = 2,
  Psi = NULL,
  burnin = 10,
  noise = c("mnormal", "mt"),
  sigma = NULL,
  df = 4
)

Arguments

n

number of observations to generate.

d

dimension of the time series.

Psi

array of p \geq 1 coefficient matrices. Psi[,,k] is the k-th coefficient. If no value is set then we generate a vector autoregressive process of order 1. Then, Psi[,,1] is proportional to \exp(-(i+j)\colon 1\leq i, j\leq d) and such that the spectral radius of Psi[,,1] is 1/2.

burnin

an integer \geq 0. It specifies a number of initial observations to be trashed to achieve stationarity.

noise

mnormal for multivariate normal noise or mt for multivariate student t noise. If not specified mnormal is chosen.

sigma

covariance or scale matrix of the innovations. By default the identity matrix.

df

degrees of freedom if noise = "mt".

Details

We simulate a vector autoregressive process

X_t=\sum_{k=1}^p \Psi_k X_{t-k}+\varepsilon_t,\quad 1\leq t\leq n.

The innovation process \varepsilon_t is either multivariate normal or multivariate t with a predefined covariance/scale matrix sigma and zero mean. The noise is generated with the package mvtnorm. For Gaussian noise we use rmvnorm. For Student-t noise we use rmvt. The parameters sigma and df are imported as arguments, otherwise we use default settings. To initialise the process we set [X_{1-p},\ldots,X_{0}]=[\varepsilon_{1-p},\ldots,\varepsilon_{0}]. When burnin is set equal to K then, n+K observations are generated and the first K will be trashed.

Value

A matrix with d columns and n rows. Each row corresponds to one time point.

See Also

rma


[Package freqdom version 2.0.5 Index]