Skip to contents

Index a cia_post_chains object with respect to iterations.

Usage

# S3 method for class 'cia_post_chains'
list()[i, ...]

Arguments

x

A cia_post_chain object.

i

An index to get the cia_post_chain iterations.

...

ellipsis for extra indexing parameters.

Value

chain A cia_post_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)
dag_chains <- PartitiontoDAG(results, scorer)

pedge_sample <- SampleEdgeProbabilities(dag_chains)
pedge_sample[5, ]
#> [[1]]
#>  [1] 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0
#> attr(,"class")
#> [1] "cia_post_chain"
#> 
#> [[2]]
#>  [1] 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0
#> attr(,"class")
#> [1] "cia_post_chain"
#> 
#> attr(,"class")
#> [1] "cia_post_chains"