Learn R Programming

ragt2ridges (version 0.3.4)

dataVARX1: Sample data from a VARX(1) model

Description

Sample data from a VARX(1) model.

Usage

dataVARX1(X, A, B, SigmaE, lagX)

Arguments

X

Three-dimensional array containing the time-varying covariates. The first, second and third dimensions correspond to covariates, time and samples, respectively. The data are assumed to be centered covariate-wise.

A

A matrix \(\mathbf{A}\) of autoregression parameters.

B

A matrix \(\mathbf{B}\) of regression parameters of the time-varying covariates stored in the array X.

SigmaE

Covariance matrix of the errors (innovations).

lagX

An integer, either 0 or 1, specifying whether \(\mathbf{X}_t\) or \(\mathbf{X}_{t-1}\) affects \(\mathbf{Y}_t\), respectively.

Value

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

See Also

createA, createS, 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
Ax     <- createA(3, "chain")

# generate time-varying covariate data
X <- dataVAR1(n, T, Ax, SigmaE)

# autoregression parameter matrices of VARX(1) model
A <- createA(p, topology="clique", nonzeroA=0.1, nClique=1)
B <- createA(p, topology="hub",    nonzeroA=0.1, nHubs=1)

# generate data
Y <- dataVARX1(X, A, B, SigmaE, lagX=0)
# }

Run the code above in your browser using DataLab