Skip to contents

Index a cia_chains object

Usage

# S3 method for class 'cia_chains'
x[[i, ...]]

Arguments

x

A cia_chains object.

i

An index to get the cia_chain.

...

ellipsis for extra indexing parameters.

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)
results[[1]][1:3]
#> $state
#> $state[[1]]
#>   partition node
#> 1         1    D
#> 2         2    A
#> 3         3    C
#> 4         4    E
#> 5         5    F
#> 6         6    B
#> 
#> $state[[2]]
#>   partition node
#> 1         1    D
#> 2         2    A
#> 3         3    C
#> 4         4    E
#> 5         5    F
#> 6         6    B
#> 
#> $state[[3]]
#>   partition node
#> 1         1    D
#> 2         2    A
#> 3         3    C
#> 4         4    E
#> 5         5    F
#> 6         6    B
#> 
#> 
#> $log_score
#> [1] -24189.72 -24189.72 -24189.72
#> 
#> $proposal_info
#> $proposal_info[[1]]
#> $proposal_info[[1]]$proposal_used
#> [1] "node_move"
#> 
#> 
#> $proposal_info[[2]]
#> $proposal_info[[2]]$proposal_used
#> [1] "node_move"
#> 
#> 
#> $proposal_info[[3]]
#> $proposal_info[[3]]$proposal_used
#> [1] "node_move"
#> 
#> 
#> 
#> $mcmc_info
#> $mcmc_info[[1]]
#> $mcmc_info[[1]]$accept
#> [1] FALSE
#> 
#> $mcmc_info[[1]]$white_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[1]]$black_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[1]]$jac
#> [1] 0.1823216
#> 
#> $mcmc_info[[1]]$mhr
#> [1] -155.3165
#> 
#> 
#> $mcmc_info[[2]]
#> $mcmc_info[[2]]$accept
#> [1] FALSE
#> 
#> $mcmc_info[[2]]$white_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[2]]$black_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[2]]$jac
#> [1] 0.1823216
#> 
#> $mcmc_info[[2]]$mhr
#> [1] -93.02662
#> 
#> 
#> $mcmc_info[[3]]
#> $mcmc_info[[3]]$accept
#> [1] FALSE
#> 
#> $mcmc_info[[3]]$white_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[3]]$black_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[3]]$jac
#> [1] 0.1823216
#> 
#> $mcmc_info[[3]]$mhr
#> [1] -941.9007
#> 
#> 
#> 
#> attr(,"class")
#> [1] "cia_chain"