Skip to contents

Sample chains

Usage

SampleChains(
  n_results,
  init_state,
  transition,
  scorer,
  n_thin = 1,
  n_parallel_chains = 2
)

Arguments

n_results

Number of saved states per chain.

init_state

An initial state that can be passed to transition. This can be a single state or a list of states for each parallel chain.

transition

A transition function.

scorer

A scorer object.

n_thin

Number of steps between saved states.

n_parallel_chains

Number of chains to run in parallel. Default is 2.

Value

A cia_chains object.

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(), scorer)