SamplePosteriorPredictiveChains | R Documentation |
Simulate samples from a posterior predictive distribution for a feature f(g)
a graph g
.
SamplePosteriorPredictiveChains(x, p_predict, ...)
x |
A cia_chain(s) object. |
p_predict |
A function that draws from the posterior predictive distribution of interest given an adjacency matrix representing a DAG. The function must be of the form p_predict(dag, ...) and return either a vector of numeric values. |
... |
Parameters to be passed to p_predict. |
A cia_post_chain(s) object.
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)
# Sample the edge probability.
SamplePosteriorPredictiveChains(dag_chains, function(dag) { return(dag) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.