tsnetwork: Time Series Chain Graphical Models for mixed...

Description Usage Arguments Author(s) References Examples

View source: R/tsnetwork.R

Description

Reconstructing instantaneous (undirected) and dynamic (directed) networks from repeated multivariate mixed discrete-continuous or ordinal time series data. This function computes sparse an autoregressive coefficient and a precision matrices for time series chain graphical models.

Usage

1
2
3
4
 tsnetwork(dat, lower, upper, penalty= "scad", n_lam1= NULL, 
      lam1_ratio= NULL, n_lam2= NULL, lam2_ratio= NULL, em_tol= NULL,
      em_iter= NULL, iter_Mstep= NULL, pen_diag_gamma= FALSE,
      ncores = 1)

Arguments

dat

Longitudinal data format

lower

Lower boundry of the data. Can be cimouted internally. Deafult is NULL.

upper

Upper boundry of the data. Can be cimouted internally. Deafult is NULL.

penalty

This specifies the type of penalty function to be used. SCAD penalty function is applied if penalty = "scad" and GLASSO is applied if penalty = "lasso"

n_lam1

The number of regularization parameters for the instantaneous interactions.

lam1_ratio

Determines the sequence of lam1.

n_lam2

The number of regularization parameters for the dynamics interactions.

lam2_ratio

Determines the sequence of lam2.

em_tol

A value to meet the convergence criteria of the EM algorithm. Default value is 0.01

em_iter

The number of EM iterations. The default value is 10.

iter_Mstep

The number of iterations in the M-step to guarantee the convergence. The default value is 5.

pen_diag_gamma

Penalazing the diagonal elements of the autoregressive matrix.

ncores

The number of cores to use for the calculations.

Author(s)

Pariya Behrouzi
Maintainer: Pariya Behrouzi <pariya.behrouzi@gmail.com>

References

Pariya Behrouzi, Fentaw Abegaz and Ernst Wit (2018). Dynamic Chain Graph Models for Ordinal Time Series Data. Arxiv. 14, 3: 586-599.

Fentaw Abegaz and Ernst Wit (2013). Sparse time series chain graphical models for reconstructing genetic networks. Biostatistics. 14, 3: 586-599.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
simulate <- gen.sim(t = 3, n = 2, p = 3, k = 3, network = "scale-free") 
sim.dat <- simulate$dat
out <- tsnetwork(dat =sim.dat, lower= NULL, upper= NULL, penalty= "lasso",
                 n_lam1= 1, lam1_ratio= NULL, n_lam2= 1, lam2_ratio= NULL, em_tol = NULL,
                 em_iter= 1, iter_Mstep = 1, pen_diag_gamma= FALSE, ncores = 1)

# Estimated sparse precision (undirected) and autoregression (directed) matrices
undirected <- out$theta[ , , 1, 1]
directed <- out$gamma[ , , 1, 1]

oldpar <- par(no.readonly =TRUE)
par(mfrow=c(1,2))
plotG(undirected, mod="undirected", main= "Estimated precision matrix", label=TRUE)     
plotG(directed, mod="directed", main ="Estimated autoregression coef. matrix", label=TRUE) 
par(oldpar)

tsnetwork documentation built on March 26, 2020, 6:45 p.m.