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 |
burnin |
an integer |
noise |
|
sigma |
covariance or scale matrix of the innovations. By default the identity matrix. |
df |
degrees of freedom if |
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.