View source: R/acceptance_rates.R
CalculateAcceptanceRates | R Documentation |
This makes the assumption that the proposal has saved a variable "proposal_used" and mcmc has saved a variable 'accept'.
CalculateAcceptanceRates(chains, group_by = NULL)
chains |
MCMC chains. |
group_by |
Vector of strings that are in c("chain", "proposal_used"). Default is NULL which will return the acceptance rates marginalised over chains and the proposal used. |
Summary of acceptance rates per grouping.
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)
CalculateAcceptanceRates(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.