# NOT RUN {
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10
# set model parameters
SigmaE <- diag(p)/4
Ax <- createA(p, "chain", nBands=1)
# generate time-varying covariates in accordance with VAR(1) process
X <- dataVAR1(n, T, Ax, SigmaE)
# set model parameters
B <- createA(p, "clique", nCliques=1)
A <- createA(p, "hub", nHubs=1)
# generate time-varying covariates in accordance with VAR(1) process
Y <- dataVARX1(X, A, B, SigmaE, lagX=0)
# fit VARX(1) model
VARX1hat <- ridgeVARX1(Y, X, 1, 1, 1, lagX=0)
## determine which elements of A are non-null
# }
# NOT RUN {
Anullornot <- matrix(0, p, p)
# }
# NOT RUN {
Anullornot[sparsifyVARX1(X, VARX1hat$A, VARX1hat$B,
solve(VARX1hat$P), threshold="localFDR")$nonzeros] <- 1
# }
# NOT RUN {
## REASON FOR NOT RUN:
## the employed local FDR approximation is only valid for reasonably sized
## number of elements of A (say) at least p > 10 and,
## consequently, a vector of 100 regression coefficients.
## plot non-null structure of A
# }
# NOT RUN {
edgeHeat(Anullornot)
# }
Run the code above in your browser using DataLab