BayesianModelSelectionResult#
- class gammapy.modeling.BayesianModelSelectionResult[source]#
Bases:
objectContainer for results of multiple Bayesian model sampling.
Provides utilities to compare models and compute differences in statistical metrics.
- Parameters:
- results_dictdict
Dictionary of InferenceResult objects with key matching model name.
Attributes Summary
Expected log predictive density using PSIS-LOO-CV.
Methods Summary
compare(**kwargs)Compare models using ArviZ's model comparison utilities.
Display prior and likelihood sensitivity table computed from power scaling for each model.
stats_difference_table(reference_models_name)Compute difference in statistics relative to a reference model.
stats_table([format])Statistics summary table for all models.
Attributes Documentation
- elpds#
Expected log predictive density using PSIS-LOO-CV.
- models_names#
Methods Documentation
- compare(**kwargs)[source]#
Compare models using ArviZ’s model comparison utilities.
This method extracts the LOO-CV expected log predictive densities (ELPDs) from each model result and passes them to
arviz.comparefor statistical comparison. By default, the method is set to ‘BB-pseudo-BMA’ which performs a Bayesian bootstrap to compute standard errors, and weights.- Parameters:
- **kwargsdict
Additional keyword arguments passed to
arviz.compare.
- Returns:
- comparison
DataFrame A data frame with model comparison metrics such as ELPD differences, standard errors, and weights.
- comparison
- prior_sensitivity_table()[source]#
Display prior and likelihood sensitivity table computed from power scaling for each model.
- stats_difference_table(reference_models_name)[source]#
Compute difference in statistics relative to a reference model.
This table contains a set of information criteria and diagnostics used to evaluate and compare statistical models. The columns are defined as follows:
Model (prior) : the model identifier, including its prior specification.
-2logz : negative twice the log Bayesian evidence.
-2logl : negative twice the maximum log-likelihood.
AIC : Akaike Information Criterion.
elpd : expected log predictive density estimated via LOO-CV.
dof : estimated number of effective degrees of freedom.
eff. dof : effective number of parameters computed from LOO.
- Parameters:
- reference_models_namestr
Name of the model to use as reference (H0).
- Returns:
- table
Table Table with differences in statistics (H0 - H1).
- table
- stats_table(format='.3f')[source]#
Statistics summary table for all models.
This table contains a set of information criteria and diagnostics used to evaluate and compare statistical models. The columns are defined as follows:
Model (prior) : the model identifier, including its prior specification.
-2logz : negative twice the log Bayesian evidence.
-2logl : negative twice the maximum log-likelihood.
AIC : Akaike Information Criterion.
elpd : expected log predictive density estimated via LOO-CV.
dof : estimated number of effective degrees of freedom.
eff. dof : effective number of parameters computed from LOO.
logz error : uncertainty on the log Bayesian evidence.
elpd error : standard error of the LOO-based ELPD estimate.
good Pareto k fraction : fraction of pixels with Pareto k ≤ 0.7, indicating reliable LOO estimates.
- Parameters:
- formatstr, optional
Format string for numerical columns Default is “.3f”
- Returns:
- table
Table Table with statistics for each model.
- table
- classmethod __new__(*args, **kwargs)#