Skip to contents

This constructs a proposal function for PartitionMCMC.

Usage

DefaultProposal(p = c(0.33, 0.33, 0.165, 0.165, 0.01), verbose = TRUE)

Arguments

p

Probability for each proposal in the order (split_join, node_move, swap_node, swap_adjacent, stay_still).

verbose

Boolean flag to record proposal used.

Value

A function corresponding to the default proposal.

Examples

data <- bnlearn::learning.test

dag <- UniformlySampleDAG(colnames(data))
partitioned_nodes <- DAGtoPartition(dag)

scorer <- CreateScorer(
  scorer = BNLearnScorer, 
  data = data
  )

results <- SampleChains(10, partitioned_nodes, 
                        PartitionMCMC(
                          proposal = DefaultProposal(p = c(0.0, 1.0, 0.0, 0.0, 0.0))
                          ), 
                        scorer)