| sparse.tscgm | R Documentation |
Computes sparse vector autoregressive coefficient matrices of order 1 and 2
and precision matrix estimates for time series chain graphical models using
SCAD or LASSO penalties. In time series chain graphs, directed edges
are identified by nonzero entries of the autoregressive coefficients matrix
and undirected edges are identified by nonzero entries of the precision matrix.
sparse.tscgm(
data = data,
lam1 = NULL,
lam2 = NULL,
nlambda = NULL,
model = c("ar1", "ar2"),
penalty = c("scad", "lasso"),
optimality = c("NULL", "bic", "bic_ext", "bic_mod", "aic", "gic"),
control = list()
)
data |
Longitudinal data format (matrix or data.frame). |
lam1 |
Numeric. Scalar or vector of tuning parameter values for the precision matrix penalty.
If |
lam2 |
Numeric. Scalar or vector of tuning parameter values for the autoregression matrix penalty.
If |
nlambda |
Integer. Number of tuning parameter values to generate if |
model |
Character. Order of the vector autoregressive model. Choices: |
penalty |
Character. Type of penalty to use. Choices: |
optimality |
Character. Information criterion for model selection. Choices:
|
control |
List. Control parameters for the algorithm:
|
For description of the objective functions and computational details, see Abegaz and Wit (2013).
A list containing:
Estimated precision matrix. Nonzero entries represent undirected edges.
Estimated autoregressive coefficient matrix. Nonzero entries represent directed edges.
Optimal tuning parameter for the precision matrix.
Optimal tuning parameter for the autoregression matrix.
Minimum value of the selected information criterion.
Matrix of tuning parameters and corresponding information criterion values.
Sequence of precision matrix tuning parameters.
Sequence of autoregression matrix tuning parameters.
Sparsity level of the precision matrix.
Sparsity level of the autoregression matrix.
Fentaw Abegaz and Ernst Wit (2013). Sparse time series chain graphical models for reconstructing genetic networks. Biostatistics, 14(3), 586–599.
Rothman, Levina, and Zhu (2010). Sparse multivariate regression with covariance estimation. Journal of Computational and Graphical Statistics, 19, 947–962.
seed <- 321
datas <- sim.data(model="ar1", time=10, n.obs=10, n.var=5, seed=seed, prob0=0.35, network="random")
data.fit <- datas$data1
prec_true <- datas$theta
autoR_true <- datas$gamma
res.tscgm <- sparse.tscgm(data=data.fit, lam1=NULL, lam2=NULL, nlambda=NULL,
model="ar1", penalty="scad", optimality="bic_mod",
control=list(maxit.out=10, maxit.in=100))
# Estimated sparse precision and autoregression matrices
prec <- res.tscgm$theta
autoR <- res.tscgm$gamma
# Optimal tuning parameter values
lambda1.opt <- res.tscgm$lam1.opt
lambda2.opt <- res.tscgm$lam2.opt
# Sparsity levels
sparsity_theta <- res.tscgm$s.theta
sparsity_gamma <- res.tscgm$s.gamma
# Graphical visualization
oldpar <- par(mfrow=c(2,2))
plot.tscgm(datas, mat="precision", main="True precision matrix")
plot.tscgm(res.tscgm, mat="precision", main="Estimated precision matrix")
plot.tscgm(datas, mat="autoregression", main="True autoregression coef. matrix")
plot.tscgm(res.tscgm, mat="autoregression", main="Estimated autoregression coef. matrix")
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.