Learn R Programming

ragt2ridges (version 0.3.4)

dataVAR1: Sample data from a VAR(1) model

Description

Sample data from a VAR(1) model.

Usage

dataVAR1(n, T, A, 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.

A

Matrix \(\mathbf{A}\) of 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

ridgeVAR1.

Examples

Run this code
# NOT RUN {
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A      <- matrix(c(-0.1, -0.3,  0.6, 
                    0.5, -0.4,    0, 
                    0.3, -0.5, -0.2), byrow=TRUE, ncol=3)

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

Run the code above in your browser using DataLab