View source: R/edge_probabilities.R
CalculateEdgeProbabilities | R Documentation |
Calculate pairwise edge probabilities. The posterior probability of an edge
E
given the data D
is given by marginalising out
the graph structure g
over the graph space G
, such that
p(E|D) = \sum_{g \in G} p(E|g)p(g|D).
CalculateEdgeProbabilities(x, ...)
x |
A cia_chain(s) or collection object where states are DAGs. |
... |
Extra parameters sent to the methods. For a dag collection you can choose to use estimated p(g|D) in two ways which can be specified using the 'method' parameter.method='sampled' for MCMC sampled frequency (which is our recommended method) or method='score' which uses the normalised scores. |
The posterior probability for a given graph p(g|D) is estimated in two ways which can be specified using the 'method' parameter.
Matrix of edge probabilities.
data <- bnlearn::learning.test
dag <- UniformlySampleDAG(colnames(data))
partitioned_nodes <- DAGtoPartition(dag)
scorer <- CreateScorer(
scorer = BNLearnScorer,
data = data
)
results <- SampleChains(10, partitioned_nodes, PartitionMCMC(), scorer)
dag_chains <- PartitiontoDAG(results, scorer)
CalculateEdgeProbabilities(dag_chains)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.