PlotCumulativeMeanTrace | R Documentation |
Plot cumulative mean trace plot.
PlotCumulativeMeanTrace(
x,
ncol = NULL,
nrow = NULL,
scales = "fixed",
dir = "v"
)
x |
A posterior predictive sample object. |
ncol |
Number of columns. |
nrow |
Number of rows. |
scales |
Whether the scales should the fixed ('fixed', the default), free ('free') or free in one dimension ('free_x', 'free_y')? |
dir |
Direction to fill facets. Either 'h' for horizontal or 'v' for vertical. |
A ggplot 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.
p_edge <- function(dag) { return(as.vector(dag)) }
pedge_sample <- SamplePosteriorPredictiveChains(dag_chains, p_edge)
PlotCumulativeMeanTrace(pedge_sample,
nrow = length(data),
ncol = length(data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.