#### 5. Um exemplo em dados simulados
data.sim <- bdgraph.sim( n = 60, p = 8, graph = "scale-free", type = "Gaussian" )
round( head( data.sim $ data, 4 ), 2 )
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,] 0.36 -0.93 0.62 -0.41 0.31 -0.60 -0.64 -0.36
## [2,] -0.34 -0.99 -0.02 -1.19 -0.61 -0.30 0.19 -0.91
## [3,] -0.80 0.62 1.31 -0.71 0.02 -1.64 -1.57 -0.88
## [4,] -0.32 -1.09 0.51 -1.96 -0.62 -1.10 -2.03 0.36
sample.bdmcmc <- bdgraph( data = data.sim, method = "ggm",
algorithm = "bdmcmc", iter = 5000, save = TRUE)
## 5000 MCMC sampling ... in progress:
## 10%->20%->30%->40%->50%->60%->70%->80%->90%-> done

## $selected_g
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,] 0 0 1 0 1 0 0 0
## [2,] 0 0 0 0 0 0 0 0
## [3,] 0 0 0 0 0 0 0 1
## [4,] 0 0 0 0 0 0 0 0
## [5,] 0 0 0 0 0 0 0 0
## [6,] 0 0 0 0 0 0 1 0
## [7,] 0 0 0 0 0 0 0 0
## [8,] 0 0 0 0 0 0 0 0
##
## $p_links
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,] 0 0.1 1.00 0.03 1.00 0.15 0.06 0.03
## [2,] 0 0.0 0.03 0.12 0.05 0.04 0.04 0.04
## [3,] 0 0.0 0.00 0.03 0.11 0.09 0.07 1.00
## [4,] 0 0.0 0.00 0.00 0.04 0.03 0.02 0.03
## [5,] 0 0.0 0.00 0.00 0.00 0.06 0.04 0.04
## [6,] 0 0.0 0.00 0.00 0.00 0.00 1.00 0.04
## [7,] 0 0.0 0.00 0.00 0.00 0.00 0.00 0.03
## [8,] 0 0.0 0.00 0.00 0.00 0.00 0.00 0.00
##
## $K_hat
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,] 4.32 -0.03 1.43 0.00 -2.52 -0.05 -0.01 0.01
## [2,] -0.03 1.06 0.00 -0.03 -0.01 0.00 0.00 -0.01
## [3,] 1.43 0.00 2.65 0.00 -0.06 0.02 0.02 -1.01
## [4,] 0.00 -0.03 0.00 0.89 -0.01 0.00 0.00 0.00
## [5,] -2.52 -0.01 -0.06 -0.01 2.90 -0.01 0.00 -0.01
## [6,] -0.05 0.00 0.02 0.00 -0.01 5.38 -4.77 0.01
## [7,] -0.01 0.00 0.02 0.00 0.00 -4.77 5.14 0.00
## [8,] 0.01 -0.01 -1.01 0.00 -0.01 0.01 0.00 1.69