Learn R Programming

bivarhr (version 0.1.5)

summarise_hurdle_top3_posthoc: Summarise top-3 Hurdle-NB models across control combos

Description

Extracts and summarises the top three Hurdle-NB specifications (by estimated ELPD) from BMA selection tables, either taken from an in-memory list of results or read from CSV files on disk.

Usage

summarise_hurdle_top3_posthoc(bma_per_combo, dir_csv)

Value

A data frame with up to three rows and columns:

  • model: constant string "Hurdle-NB".

  • config: textual description of the specification.

  • elpd, elpd_se, weight: selection metrics from the BMA table.

  • k, hs_tau0, hs_slab_scale, hs_slab_df, combo: numeric tuning parameters and control-combo tag.

If no valid tables are found, a single-row data frame with NA

entries is returned.

Arguments

bma_per_combo

Optional named list of BMA results by control combination, where each element contains a component $table with columns such as elpd, elpd_se, weight, k, hs_tau0, hs_slab_scale, hs_slab_df, etc.

dir_csv

Character scalar; directory where BMA weight CSV files "bma_weights_specC_ctrl*.csv" are stored if bma_per_combo is NULL or empty.

Details

If bma_per_combo is provided and non-empty, the function uses its $table components. Otherwise, it scans dir_csv for BMA weight files matching the pattern "bma_weights_specC_ctrl*.csv" and reads them.

All valid rows are combined, ordered by decreasing elpd, and the top three models are retained. For each, a human-readable configuration string summarising k, the horseshoe hyperparameters and the control combo is constructed.