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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot.tscgm.ar2.r

Description

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

Usage

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

Arguments

x

an object of class sparse.tscgm.

mat

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

...

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
19
20
21
22
23
24
25
26
27
## Data generation from time series chain graphical model with vector 
## autoregressive model of order 2
seed = 321
datas <- sim.data(model="ar2", time=10,n.obs=20, n.var=5,seed=seed,prob0=0.35,
         network="random")
data.fit <-  datas$data1

## Model fitting with vector autoregressive order 2
 res.tscgm <- sparse.tscgm(data=data.fit, lam1=NULL, lam2=NULL, nlambda=NULL, 
 model="ar2", penalty="scad",optimality="bic_mod",control=list(maxit.out = 10, maxit.in = 100))
  
#Network visualization
oldpar<-par(mfrow=c(3,2))
plot.tscgm.ar2(datas, mat="precision",main="True precision matrix")
plot.tscgm.ar2(res.tscgm, mat="precision",main="Estimated precision matrix")
     
plot.tscgm.ar2(datas, mat="autoregression1", 
        main="True autoregression coef. matrix of lag 1" )    
plot.tscgm.ar2(res.tscgm, mat="autoregression1",
           main="Estimated autoregression coef. matrix of lag 1")
            
plot.tscgm.ar2(datas, mat="autoregression2",
      main="True autoregression coef. matrix of lag 2")    
plot.tscgm.ar2(res.tscgm, mat="autoregression2",
           main="Estimated autoregression coef. matrix of lag 2") 
par(oldpar)
 

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