calibrain.UncertaintyEstimator#

class calibrain.UncertaintyEstimator(nominal_coverages=None, logger=None)[source]#

Uncertainty estimator for fixed- and free-orientation source estimates.

Supported settings#

  1. Fixed orientation (EEG or MEG): - pointwise marginal credible interval membership - aggregated-mean marginal credible interval membership

  2. Free orientation EEG: - pointwise 3D credible ellipsoid membership - aggregated-mean 3D credible ellipsoid membership

  3. Free orientation MEG (reduced rank-2 model): - pointwise 2D credible ellipse membership in reduced coordinates - aggregated-mean 2D credible ellipse membership in reduced coordinates

Modeling convention#

  • posterior mean varies over time

  • posterior covariance is static over time

  • when aggregating by time-average, covariance is scaled by 1 / T

Important MEG convention#

For MEG, the inverse model is assumed to be built on a reduced 2-orientation leadfield obtained source-wise via SVD or, preferably, taken directly from the extractor as Q_basis. Therefore:

  • truth can be represented in reduced coordinates a_true with shape (N,2,T)

  • if needed, truth can be lifted to local 3D via Q_basis -> shape (N,3,T)

  • posterior mean is in reduced 2D coordinates, shape (N,2,T)

  • posterior covariance is in reduced coordinates, shape (2N,2N)