PlotScoreTrace | R Documentation |
Plot the score trace
PlotScoreTrace(
chains,
attribute = "log_score",
n_burnin = 0,
same_plot = TRUE,
col = NULL,
...
)
chains |
MCMC chains. |
attribute |
Name of attribute to plot. Default is "log_score". |
n_burnin |
Number of steps to remove as burnin. |
same_plot |
Whether to plot on the same figure or on multiple figures. |
col |
A string representing a color for a single chain or a vector of strings to cycle through for multiple chains. |
... |
Extra parameters to pass to the plot and graphics::line functions. |
No return value. Called to produce a base R trace plot.
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)
# Plot partition score trace.
PlotScoreTrace(results, type = 'l')
# Plot DAG score trace.
dag_chains <- PartitiontoDAG(results, scorer)
PlotScoreTrace(dag_chains, type = 'l')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.