This makes the assumption that the proposal has saved a variable "proposal_used" and mcmc has saved a variable 'accept'.
Examples
data <- bnlearn::learning.test
dag <- UniformlySampleDAG(colnames(data))
#> Loading required namespace: igraph
partitioned_nodes <- DAGtoPartition(dag)
scorer <- CreateScorer(
scorer = BNLearnScorer,
data = data
)
results <- SampleChains(10, partitioned_nodes, PartitionMCMC(), scorer)
CalculateAcceptanceRates(results)
#> # A tibble: 1 × 5
#> mean_accept mean_black_obeyed mean_white_obeyed n_accept n_total
#> <dbl> <dbl> <dbl> <int> <int>
#> 1 0.2 1 1 4 20