Generates a zero mean vector autoregressive process of a given order.
rar(
n,
d = 2,
Psi = NULL,
burnin = 10,
noise = c("mnormal", "mt"),
sigma = NULL,
df = 4
)
A matrix with d
columns and n
rows. Each row corresponds to one time point.
number of observations to generate.
dimension of the time series.
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.
an integer \(\geq 0\). It specifies a number of initial observations to be trashed to achieve stationarity.
mnormal
for multivariate normal noise or mt
for multivariate student t noise. If not specified mnormal
is chosen.
covariance or scale matrix of the innovations. By default the identity matrix.
degrees of freedom if noise = "mt"
.
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.
rma