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

scorer <- CreateScorer(
  scorer = BNLearnScorer, 
  data = data
  )
  
init_state <- InitPartition(colnames(data), scorer)

results <- SampleChains(10, init_state, PartitionMCMC(), scorer)
results[[1]][1:3]
#> $state
#> $state[[1]]
#>   partition node
#> 1         1    A
#> 2         1    E
#> 3         2    D
#> 4         3    F
#> 5         4    B
#> 6         5    C
#> 
#> $state[[2]]
#>   partition node
#> 1         1    A
#> 2         1    E
#> 3         2    D
#> 4         3    F
#> 5         4    B
#> 6         5    C
#> 
#> $state[[3]]
#>   partition node
#> 1         1    A
#> 2         2    E
#> 3         3    D
#> 4         4    F
#> 5         5    B
#> 6         6    C
#> 
#> 
#> $log_score
#> [1] -24525.10 -24525.10 -24353.44
#> 
#> $proposal_info
#> $proposal_info[[1]]
#> $proposal_info[[1]]$proposal_used
#> [1] "node_move"
#> 
#> 
#> $proposal_info[[2]]
#> $proposal_info[[2]]$proposal_used
#> [1] "stay_still"
#> 
#> 
#> $proposal_info[[3]]
#> $proposal_info[[3]]$proposal_used
#> [1] "split_join"
#> 
#> 
#> 
#> $mcmc_info
#> $mcmc_info[[1]]
#> $mcmc_info[[1]]$accept
#> [1] TRUE
#> 
#> $mcmc_info[[1]]$white_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[1]]$black_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[1]]$jac
#> [1] -0.1743534
#> 
#> $mcmc_info[[1]]$mhr
#> [1] 583.1512
#> 
#> 
#> $mcmc_info[[2]]
#> $mcmc_info[[2]]$accept
#> [1] TRUE
#> 
#> $mcmc_info[[2]]$white_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[2]]$black_obeyed
#> [1] TRUE
#> 
#> $mcmc_info[[2]]$jac
#> [1] 0
#> 
#> $mcmc_info[[2]]$mhr
#> [1] 0
#> 
#> 
#> $mcmc_info[[3]]
#> $mcmc_info[[3]]$accept
#> [1] TRUE
#> 
#> $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] 171.6548
#> 
#> 
#> 
#> attr(,"class")
#> [1] "cia_chain"