plot.tscgm: Plot sparse.tscgm objects from fitting chain graphical models...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot.tscgm.R

Description

plot.tscgm is a generic plot function that is adapted for objects of class sparse.tscgm.

Usage

1
2
 ## S3 method for class 'tscgm'
plot(x, mat=c("precision","autoregression"),...)

Arguments

x

an object of class sparse.tscgm.

mat

Name of matrix to be plotted,i.e., either the precision matrix or vector autoregression matrix.

...

Arguments to be passed to graphical parameters (see par).

Value

Undirected or directed networks.

Author(s)

Fentaw Abegaz and Ernst Wit

See Also

network

Examples

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

 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))
  
#Network visualization
oldpar <- par(mfrow=c(2,1))
plot.tscgm(res.tscgm, mat="precision", main="Undirected network", pad = 0.01,
  label.pad = 0.3, label.col = 6, vertex.col = 5,vertex.cex = 1.5,
  edge.col = 4, mode = "fruchtermanreingold", interactive=FALSE)
       
plot.tscgm(res.tscgm, mat="autoregression", main="Directed network", pad = 0.01,
  label.pad = 0.3, label.col = 6, vertex.col = 5,vertex.cex = 1.5,
  edge.col = 4, mode = "fruchtermanreingold", interactive=FALSE)
par(oldpar)

SparseTSCGM documentation built on Jan. 16, 2021, 5:10 p.m.