| BF | R Documentation |
Compute the Bayes factor between the structures of two Bayesian networks.
BF(num, den, data, score, ..., log = TRUE)
num, den |
two objects of class |
data |
a data frame containing the data to be used to compute the Bayes factor. |
score |
a character string, the label of a posterior network score, a
BIC scores or |
... |
extra tuning arguments for the posterior scores. See
|
log |
a boolean value. If |
A single numeric value, the Bayes factor of the two network structures
num and den.
The Bayes factor for two network structures, by definition, is the ratio of
the respective marginal likelihoods. If we assume the uniform prior
over all possible DAGs, it is equivalent to the ratio of the corresponding
posterior probabilities. However, note that it is possible to specify
different priors using the “...” arguments of BF(). In
that case, the value returned by the function will not be the standard Bayes
factor.
Marco Scutari
score, compare,
bf.strength.
data(learning.test)
dag1 = model2network("[A][B][F][C|B][E|B][D|A:B:C]")
dag2 = model2network("[A][C][B|A][D|A][E|D][F|A:C:E]")
BF(dag1, dag2, learning.test, score = "bds", iss = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.