sparse.tscgm: Sparse time series chain graphical models

View source: R/sparse.tscgm.R

sparse.tscgmR Documentation

Sparse time series chain graphical models

Description

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.

Usage

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()
)

Arguments

data

Longitudinal data format (matrix or data.frame).

lam1

Numeric. Scalar or vector of tuning parameter values for the precision matrix penalty. If NULL, the program generates a sequence based on nlambda.

lam2

Numeric. Scalar or vector of tuning parameter values for the autoregression matrix penalty. If NULL, a sequence is generated based on nlambda.

nlambda

Integer. Number of tuning parameter values to generate if lam1 or lam2 are NULL. Default is 10.

model

Character. Order of the vector autoregressive model. Choices: "ar1" or "ar2".

penalty

Character. Type of penalty to use. Choices: "scad" (default) or "lasso".

optimality

Character. Information criterion for model selection. Choices: "NULL" (no selection), "bic", "bic_ext", "bic_mod", "aic", "gic".

control

List. Control parameters for the algorithm:

maxit.out

Maximum outer iterations (default 5).

maxit.in

Maximum inner iterations (default 50).

tol.out

Convergence tolerance (default 1e-4).

silent

TRUE/FALSE, whether to print progress messages (default TRUE).

Details

For description of the objective functions and computational details, see Abegaz and Wit (2013).

Value

A list containing:

theta

Estimated precision matrix. Nonzero entries represent undirected edges.

gamma

Estimated autoregressive coefficient matrix. Nonzero entries represent directed edges.

lam1.opt

Optimal tuning parameter for the precision matrix.

lam2.opt

Optimal tuning parameter for the autoregression matrix.

min.ic

Minimum value of the selected information criterion.

tun.ic

Matrix of tuning parameters and corresponding information criterion values.

lam1.seq

Sequence of precision matrix tuning parameters.

lam2.seq

Sequence of autoregression matrix tuning parameters.

s.theta

Sparsity level of the precision matrix.

s.gamma

Sparsity level of the autoregression matrix.

References

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.

Examples

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)

SparseTSCGM documentation built on Jan. 9, 2026, 5:12 p.m.