dataVARX1: Sample data from a VARX(1) model

Description Usage Arguments Value Author(s) See Also Examples

View source: R/dataVARX1.r

Description

Sample data from a VARX(1) model.

Usage

1
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.

Author(s)

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

See Also

createA, createS, dataVAR1, dataVAR2, ridgeVARX1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

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