Description Usage Arguments Value Examples
Perform Metropolis-Hastings simulation over space of directed acyclic graphs.
1 2 3 4 |
start.nw |
Starting network |
dataset |
Data frame with observations |
reporter |
Statistic to be generated |
Nsim |
Number of simulations |
burn |
Proportion of simulations to be used as a burn-in |
verbose |
If TRUE then report messanges and plots will be given |
trace |
If TRUE then all |
score |
A function to calculate BIC |
whitelist |
For move proposal, 2-column matrix or data.frame with compulsory edges (vertices as numbers) |
blacklist |
For move proposal, 2-column matrix or data.frame with forbidden edges (vertices as numbers) |
lprior |
Log of prior distribution of acyclic directed graph |
move.score |
A function to adjust the score to addition / removal / reversal of an edge |
move.lprior |
A function to adjust the log-prior to addition / removal / reversal of an edge |
move.proposals |
A function to adjust the proposals to addition / removal / reversal of an edge |
Either average or all reporter
values based on trace
settings.
1 2 3 4 5 6 7 8 9 10 | rg <- tabu(gaussian.test)
nw <- import.bnlearn(rg)
number.of.edges <- function(nw) sum(nw$adjmat)
ne.dist <- mcmc(nw, gaussian.test, number.of.edges, verbose=FALSE, trace=TRUE)
table(do.call("c", ne.dist$trace)[101:1000]) / 900
all.edges <- function(nw) nw$adjmat
A <- mcmc(nw, gaussian.test, all.edges, verbose=FALSE, trace=FALSE)
strength.plot(export.bnlearn(nw), matrix2strength(A, nw$nodes))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.