Bayesian Model Selection

Functions for model selection/comparison.

References

[RigouxVBA3]Rigoux L., Daunizeau J. VBA Toolbox
[RigouxBMS3]Rigoux, L. et al. (2014) Neuroimage 84, 971–985
[GershmanMfit3]Samuel Gershman’s mfit package (on GitHub)

Module Documentation

class fitr.model_selection.bms.BMS(model_fits, c_limit=1e-99)

Bayesian model selection [RigouxBMS].

Attributes

modelfits (list) List of fitrfit objects from completed model fitting
nmodels (int) Number of models to be compared
nsubjects: int Number of subjects in the sample. (Must be equal across all fits).
c_limit (float) Threshold at which to stop model comparison

Methods

run(self) Runs model comparison by Bayesian Model Selection
dirichlet_exceedance(self, alpha) Computes exceedance probabilities for a Dirichlet distribution
BOR(self, L, posterior, priors, C=None) Computes Bayes Omnibus Risk (BOR)
FE(self, L, posterior, priors) Derives free energy for current approximate posterior distribution
FE_null(self, L, options): Derives the free energy of the ‘null’ hypothesis
BOR(L, posterior, priors, C=None)

Computes Bayes Omnibus Risk (BOR)

Parameters:

L

posterior

priors

C

Returns:

bor

Bayesian omnibus risk

Notes

As in [GershmanMfit].

FE(L, posterior, priors)

Derives free energy for current approximate posterior distribution [RigouxVBA].

Parameters:

L

Log model-evidence

posterior : dict

priors : dict

Returns:

F

Free energy of the current posterior

FE_null(L, options)

Derives the free energy of the ‘null’ hypothesis

Parameters:

L

Log model evidence

options : dict

Returns:

F0m

Evidence for the null (i.e. equal probabilities) over models

F0f

Evidence for the null (i.e. equal probabilities) over families

dirichlet_exceedance(alpha)

Computes exceedance probabilities for a Dirichlet distribution

Parameters:

alpha : float [0-1]

Returns:

xp

Exceedance probabilities

Notes

Implemented as in [GershmanMfit].

run()

Runs Bayesian model selection algorithm

Returns:

ModelComparisonResult :

Object representing model comparison results