Learn R Programming

ragt2ridges (version 0.1.9)

dataVAR1: Sample data from a VAR(1) model

Description

Sample data from a VAR(1) model.

Usage

dataVAR1(n, T, A, SigmaE)

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.
A
A Matrix $\mathbf{A}$ of regression parameters.
SigmaE
Covariance matrix of the errors (innovations).

Value

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

See Also

ridgeVAR1.

Examples

Run this code
# set dimensions
p <- 3; n <- 4; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A <- createA(p, "chain")

# generate data
Y <- dataVAR1(n, T, A, SigmaE)

Run the code above in your browser using DataLab