Learn R Programming

BDgraph (version 2.7)

prob: Posterior probabilities of the graphs

Description

According to the output of the BD-MCMC algorithm, this function gives us the posterior probability for the most highest graphs or a specific graph.

Usage

prob(output, g = 2, G = NULL)

Arguments

output
a list which is the result of BD-MCMC algorithm from the 'bdgraph' function.
g
you can select the number of graphs with highest probabilities (default is 1).
G
adjacency matrix which shows the graph structure. It is an upper triangular matrix in which $g_{ij}=1$ if there is a link between notes $i$ and $j$, otherwise $g_{ij}=0$.

Value

  • best.Gthe graphs with the highest posterior probabilities.
  • prob.Ga vector which includes posterior probabilities of the graphs in 'best.G'.

References

Mohammadi, A. and E. C. Wit (2012). Gaussian graphical model determination based on birth-death MCMC inference, arXiv:1210.5371v4. http://arxiv.org/abs/1210.5371v4

See Also

bdgraph

Examples

Run this code
# generating the data from a random graph
  data.sim <- bdgraph.sim(n = 100, p = 8, vis = TRUE)
  
  output   <- bdgraph(data.sim, mean = 0, iter = 2000)
  
  prob(output, G = data.sim)
  
  prob(output, g = 2)

Run the code above in your browser using DataLab