dataVAR2: Sample data from a VAR(2) model

Description Usage Arguments Value Author(s) See Also Examples

View source: R/dataVAR2.r

Description

Sample data from a VAR(2) model.

Usage

1
dataVAR2(n, T, A1, A2, SigmaE, TburnIn=1000)

Arguments

n

Positive numeric of length one: number of individuals to be sampled.

T

Positive numeric of length one: number of time points (per individual) to be sampled.

A1

A matrix \mathbf{A}_1 of lag one autoregression parameters.

A2

A matrix \mathbf{A}_2 of lag two autoregression parameters.

SigmaE

Covariance matrix of the errors (innovations).

TburnIn

Positive numeric of length one: number of time points used to burn in the process.

Value

A three dimensional array containing the data. The first, second and third dimensions correspond to covariates, time and samples, respectively.

Author(s)

Wessel N. van Wieringen <w.vanwieringen@vumc.nl>

See Also

dataVAR1, dataVAR2, ridgeVARX1, .

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 12; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A1     <- -createA(p, "clique", nCliques=1, nonzeroA=0.1)
A2     <- t(createA(p, "chain", nBands=1, nonzeroA=0.1))

# generate data
Y <- dataVAR2(n, T, A1, A2, SigmaE)

ragt2ridges documentation built on Jan. 28, 2020, 5:08 p.m.