Learn R Programming

ragt2ridges (version 0.3.4)

dataVAR2: Sample data from a VAR(2) model

Description

Sample data from a VAR(2) model.

Usage

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.

See Also

dataVAR1, dataVAR2, ridgeVARX1, .

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab