summary.chain_event_graph {stCEG} | R Documentation |
Summarise a Chain Event Graph Model
Description
Computes the total log marginal likelihood, effective sample size (ESS), and per-stage log scores for a fitted Chain Event Graph (CEG) model using conjugate prior/posterior updates.
Usage
## S3 method for class 'chain_event_graph'
summary(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments (currently unused). |
Details
The log marginal likelihood is computed using the Dirichlet-multinomial formula.
The effective sample size for a stage is defined as ESS = \sum_j (\alpha_{ij} + y_{ij})
.
It represents the amount of information (prior + observed) available for that stage.
Value
An invisible object of class summary.chain_event_graph
, which is a list containing:
- total_log_marginal_likelihood
Total log marginal likelihood across all stages.
- per_stage_log_scores
A data frame with log scores and effective sample sizes (ESS) for each stage.
Examples
data <- homicides
event_tree <- create_event_tree(data, columns = c(1,2,4,5), "both")
coloured_tree <- ahc_colouring(event_tree)
# Cannot run this whole chunk at once as specify_priors needs user input
tree_priors <- specify_priors(coloured_tree, prior_type = "Uniform", ask_edit = FALSE)
staged_tree <- staged_tree_prior(coloured_tree, tree_priors)
ceg <- create_ceg(staged_tree, view_table = TRUE)
homicides_CEG_summary <- summary(ceg)