Description Usage Arguments Value Author(s) See Also Examples
View source: R/plot.tscgm.ar2.r
plot.tscgm.ar2
is a generic plot function that is adapted
for objects of class sparse.tscgm
.
1 2 |
x |
an object of class |
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 |
Undirected or directed networks.
Fentaw Abegaz and Ernst Wit
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.