1. Home
  2. Explore
  3. Statistics
  4. Bayesian Statistics in Imaging

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Bayesian Statistics in Imaging

Bayesian Statistics and Neuroimaging

1. Why Bayesian inference is useful

Neuroimaging measures brain activity indirectly. Signals such as fMRI’s blood-oxygen-level-dependent (BOLD) response and EEG measurements at the scalp are noisy and do not directly reveal the neuronal mechanisms that produced them. Analyses therefore need to infer hidden quantities—such as effect sizes, source locations, or connections between brain regions—from observed data.

Bayesian inference provides a framework for doing this by combining what is known before collecting data with how well different explanations predict the data. It can be used to:

  • Quantify uncertainty about model parameters.

  • Express probability directly over hypotheses or parameter values.

  • Incorporate justified prior information.

  • Compare competing models.

  • Build generative models that describe how latent brain processes could produce measured signals.

These benefits depend on building a plausible model: Bayesian methods make assumptions explicit, but they do not guarantee that the assumptions are scientifically correct.


2. Frequentist and Bayesian interpretations

Frequentist statistics

Classical or frequentist methods define probability in terms of the long-run frequency of outcomes across repeated sampling. Two common examples are p-values and confidence intervals.

  • A p-value describes how likely it would be to observe data at least as extreme as the observed data, assuming a particular null hypothesis is true. In notation, it concerns the probability of data given a hypothesis, such as P(data∣H0)P(\text{data} \mid H_0)P(data∣H0​).

  • A p-value does not give the probability that the null hypothesis is true, nor the probability that a research hypothesis is true given the data.

  • A 95% confidence interval does not, in the usual frequentist interpretation, mean that there is a 95% probability that the particular interval calculated from one study contains the true value. Rather, the confidence procedure would produce intervals containing the true value in 95% of repeated samples under its assumptions.

These interpretations can be unintuitive because researchers often want to know how probable a hypothesis is after seeing the data. That is the reverse conditional probability: P(H∣data)P(H \mid \text{data})P(H∣data), rather than P(data∣H)P(\text{data} \mid H)P(data∣H).

Key distinction: The probability of observing data assuming a hypothesis is true is not the same as the probability that the hypothesis is true given the data.

Bayesian inference

Bayesian inference formalizes the process of revising beliefs in light of evidence. It begins with a prior, evaluates how well possible explanations predict the observed data through a likelihood, and combines these to produce a posterior.

Bayes’ rule is:

P(H∣D)=P(D∣H)P(H)P(D)P(H \mid D) = \frac{P(D \mid H)P(H)}{P(D)}P(H∣D)=P(D)P(D∣H)P(H)​

where:

  • P(H)P(H)P(H) is the prior probability of hypothesis HHH.

  • P(D∣H)P(D \mid H)P(D∣H) is the likelihood: the probability of the observed data DDD if HHH were true.

  • P(H∣D)P(H \mid D)P(H∣D) is the posterior probability of HHH after observing DDD.

  • P(D)P(D)P(D) is the marginal probability of the data, which normalizes the result.

For many model-estimation problems, the central relationship is written proportionally:

P(θ∣D)∝P(D∣θ)P(θ)P(\theta \mid D) \propto P(D \mid \theta)P(\theta)P(θ∣D)∝P(D∣θ)P(θ)

Here, θ\thetaθ represents a model parameter or set of parameters. The posterior distribution combines the likelihood with the prior and is the main object interpreted in Bayesian analysis.

Bayesian updating in everyday reasoning

Bayesian updating resembles ordinary reasoning:

  1. Start with a prior belief about an event.

  2. Observe new evidence.

  3. Assess how likely that evidence would be under different possibilities.

  4. Update the prior to obtain a posterior belief.

For example, someone may begin with a prior belief about the chance of rain. Cloudy, cold weather provides evidence that can increase that probability; seeing a person with an umbrella supplies another observation and may change it again. In clinical reasoning, a clinician may begin with a prior probability of a condition based on its base rate, then update that probability using test results and other observations.


3. Priors, likelihoods, and posterior distributions

Priors

A prior distribution represents uncertainty about a parameter or hypothesis before the current data are used. Priors can express existing empirical knowledge, theoretical expectations, or assumptions about plausible values.

A prior is not necessarily a claim that the researcher knows the answer in advance. It makes explicit what values are treated as more or less plausible before considering the study’s evidence.

For an effect size, for example:

  • A prior centered near zero expresses an expectation of little or no effect while allowing for uncertainty.

  • A narrower prior centered near zero expresses stronger confidence that the effect is small.

  • A flat prior assigns equal density across a range of values and represents very weak information about the parameter. An unbounded flat prior may be an improper prior: it cannot be normalized as a probability distribution, even though it may still yield a proper posterior in some analyses.

Likelihood

The likelihood describes how well different parameter values or hypotheses predict the observed data. It is derived from the model’s assumptions about how observations arise, including the way noise is represented.

A likelihood is not itself the posterior probability of a hypothesis. Bayesian updating combines it with the prior.

Posterior

The posterior distribution represents uncertainty about a parameter or hypothesis after combining the prior with the evidence in the data. It can support statements such as:

  • The probability that a hypothesis is true, under the specified model and prior.

  • The probability that a parameter lies within a particular range.

  • The uncertainty and most plausible values associated with an estimated effect.

A posterior distribution is affected by both the data and the prior. When the data are informative, the likelihood can substantially update the prior. When the data are weak or uncertain, the prior may have greater influence.

How prior strength affects an estimate

Suppose a study’s likelihood supports an effect near 222.

  • With a relatively broad prior centered near zero, the posterior will generally shift toward the likelihood while retaining some influence from the prior.

  • With a narrower prior centered near zero, the posterior will typically be pulled closer to zero because the prior expresses stronger confidence that effects are small.

  • With a sufficiently weak or flat prior, the posterior may closely resemble the likelihood.

This illustrates why prior selection matters: different plausible prior assumptions can yield different posterior conclusions, especially when data are limited.


4. Bayesian summaries and model comparison

Credible intervals

A credible interval is an interval interpreted directly through the posterior. For example, a 95% credible interval can be described as an interval containing 95% of the posterior probability for the parameter, under the model and prior used.

This differs from a confidence interval: the Bayesian interpretation directly concerns the parameter’s posterior probability, while the frequentist confidence interpretation concerns the long-run behavior of an interval-producing procedure.

Bayes factors

A Bayes factor compares the evidence for two hypotheses or models. For an alternative hypothesis H1H_1H1​ and a null hypothesis H0H_0H0​, it is commonly expressed as:

BF10=P(D∣H1)P(D∣H0)BF_{10} = \frac{P(D \mid H_1)}{P(D \mid H_0)}BF10​=P(D∣H0​)P(D∣H1​)​
  • A value near 111 indicates that the data do not distinguish the two hypotheses well.

  • A value greater than 111 favors the alternative hypothesis relative to the null.

  • A value less than 111 favors the null relative to the alternative.

  • A value greater than about 333 is sometimes used as a rough indication of evidence worth discussing, but interpretation depends on context and is not a universal threshold.

A useful feature of Bayes factors is that they can support evidence for the null hypothesis. In contrast, a non-significant frequentist test does not, by itself, establish evidence that there is no effect.

Bayes factors can sometimes be used alongside classical statistics, although whether and how to combine the approaches requires care.

Model evidence and posterior model probability

A model’s evidence, also called its marginal likelihood, measures how well the model predicts the data while accounting for its parameter uncertainty and prior assumptions. Evidence can be used to compare candidate models and, together with prior model probabilities, to calculate posterior probabilities over models.

Model comparison is meaningful only relative to the models being compared. A model with high evidence is supported over its specified alternatives; it is not thereby proven to be a complete or uniquely correct account of the brain.

Variational Bayesian inference

Complex models often have posterior distributions that are difficult to calculate exactly. Variational Bayesian methods approximate a difficult posterior with a simpler distribution, often a Gaussian. This makes inference more computationally tractable and can provide an approximation to model evidence.

That evidence can be used for model comparison. However, the approximation itself is part of the method, so its suitability should be checked rather than assumed.

Bayesian model reduction and averaging

  • Bayesian model reduction (BMR) efficiently compares related models that can be obtained from a larger model by changing assumptions or priors. It can be useful when many candidate prior structures need to be evaluated.

  • Bayesian model averaging (BMA) combines estimates across models, weighting each model according to its evidence. This can account for uncertainty over which model is best, rather than treating one selected model as certainly correct.


5. Generative models and neuroimaging inverse problems

What a generative model represents

A generative model describes how latent processes and parameters could produce observed data. It combines assumptions about the hidden quantities of interest with an observation model that maps those quantities to measurements, including noise.

For neuroimaging, a model might specify:

  1. The latent neuronal activity or other hidden brain quantity.

  2. How that quantity changes over time or interacts with other quantities.

  3. How those latent processes produce a measurable signal, such as BOLD or scalp EEG.

  4. What sources of noise and uncertainty affect the observations.

A model is therefore more than a way to calculate an estimate. It commits to an account of what the latent quantities mean and how they relate to the observed signal.

The model’s structure should generally begin with a clear scientific question or theory about the latent quantities and their relationship to observations. Bayesian inference provides a way to estimate and compare such models; it does not automatically determine which scientific model should be built.

The inverse problem

In an inverse problem, researchers observe measurements and infer the hidden causes that produced them. Neuroimaging inverse problems are often underdetermined: multiple patterns of brain activity or connectivity may be consistent with the same observed data.

For example:

  • Scalp EEG records electrical signals outside the brain, not the locations of neuronal sources directly.

  • fMRI measures BOLD signals, not directed neuronal communication directly.

  • Tractography estimates aspects of white-matter architecture, but does not provide a complete, direct map of all functional dependencies.

Because many latent explanations can fit the measurements, constraints and assumptions matter. Bayesian priors can encode justified constraints while representing uncertainty about them. A useful prior need not force a connection or effect to exist; it can instead make some values more plausible than others before considering the data.


6. Bayesian inference for effective connectivity in fMRI

Effective connectivity and dynamic causal models

Effective connectivity refers to directed influences or communication between neuronal populations. It differs from a description of whether two signals are correlated: it concerns how activity in one population influences another.

At the scale of fMRI, neuronal activity and anatomical pathways are not observed directly. A dynamic causal model (DCM) addresses this by using a state-space model that represents:

  • Latent neuronal states and how they change over time.

  • How activity in one population influences the rate of change of activity in another.

  • How those latent states are transformed through a hemodynamic model into observed BOLD signals.

In this kind of model, an AAA matrix, or transition matrix, can encode the influences between neuronal populations. Inference is needed because the measured fMRI signal is an indirect consequence of the latent neuronal dynamics.

Using structural connectivity as a prior constraint

Structural connectivity, often estimated from tractography, provides information about large-scale white-matter architecture. However, it does not map one-to-one onto functional or effective connectivity:

  • Functional dependencies can be mediated by indirect, multisynaptic pathways.

  • Tractography captures only part of the relevant anatomical structure.

  • Failure to detect a tract does not establish that no effective connection exists.

A probabilistic prior can therefore use structural connectivity to inform the prior variance of effective connections:

  • Greater structural connectivity can permit greater prior variability in an effective connection, making non-zero values more plausible.

  • The structural measure does not force the effective connection to exist.

  • The data still contribute to the posterior estimate.

This is a way to use biological information as a graded constraint rather than as a rigid rule.

Hierarchical inference across participants

In a hierarchical model, each participant has a first-level DCM, while participant-specific parameters are assumed to come from a population-level distribution. Structural connectivity can constrain that population distribution.

A key advantage is that the group-level analysis carries forward first-level posterior uncertainty. It does not reduce each participant to a single point estimate and then treat that estimate as certain. If a participant’s connection estimate is uncertain, that uncertainty remains represented at the second level.

Comparing structural-to-effective connectivity mappings

A model can specify different mappings from structural connectivity to the prior variance of effective connectivity. These mappings represent competing hypotheses about how anatomy constrains functional influence.

BMR can efficiently compare many candidate mappings; evidence-weighted averaging can then account for uncertainty across them. In the reported work:

  • Evidence-weighted mappings were positive and monotonic: stronger structural connectivity implied greater prior variance over effective connectivity.

  • The relevant scale of this relationship varied across networks.

  • The variation recapitulated a sensory-to-transmodal cortical hierarchy.

  • This suggested that the influence of structural connectivity on effective connectivity may vary with the degree of functional specialization.

The findings motivate further investigation into whether this relationship changes across psychological states, pharmacological manipulations, or disorders. Such applications were described as areas of ongoing investigation, not as settled conclusions.


7. Building and evaluating priors in complex models

The challenge of choosing priors

Prior construction is a central practical challenge. A prior can encode theory or empirical knowledge, but choosing it heuristically may simply move the uncertainty problem to a higher level.

For example, a model may use auxiliary data—such as structural connectivity—to define priors over first-level parameters. A more complete Bayesian approach would place priors over the mapping parameters themselves and infer them jointly. But this raises a further question: what priors should be assigned to those mapping parameters?

In practice, researchers may need to explore candidate mappings during model development before building a fully joint model.

Example: using network structure to inform spectral priors

A related modeling example concerned how structural degree or valency might relate to the spectral properties of endogenous fluctuations in neuronal populations. A pragmatic workflow was:

  1. Estimate network-specific mappings between structural valency and spectral exponents.

  2. Use Bayesian model averaging to obtain evidence-weighted estimates across networks.

  3. Use these estimates to set data-informed prior expectations, including prior means.

  4. Use simulations with known ground truth to determine prior precisions or variances that allow parameters to be recovered accurately on average.

This approach uses empirical structure to inform plausible priors and uses simulation to test whether those priors work as intended.

A model-development workflow

Bayesian model construction is an iterative process:

  1. Propose a plausible generative account of how latent brain processes produce observations.

  2. Specify the parameters, likelihood, priors, and any auxiliary data used to constrain inference.

  3. Simulate data from the model.

  4. Invert the model on simulated data where the generating parameters are known.

  5. Assess parameter recovery and identifiability.

  6. Check whether different candidate models can be confused with one another.

  7. Revise the model, priors, or mappings and test again.

A model may be difficult to identify if different parameter combinations produce similar observations. Simulation can reveal such problems before conclusions are drawn from real data.

The mathematical machinery may be general, but applying it is not automatically plug-and-play. Researchers must choose meaningful latent quantities, sensible auxiliary data and mappings, and priors that behave appropriately.


8. Multiple comparisons in EEG and statistical parametric mapping

Why multiple comparisons arise

EEG and other neuroimaging data can contain thousands of possible sensor-by-time comparisons. If a statistical test is conducted at each location and time point without correction, many false positives may arise simply because so many tests are performed.

The problem is especially substantial when researchers do not know in advance where or when an effect will occur. Measurements in neighboring locations and times are also correlated, so the tests are not independent.

Targeted tests versus whole-map searches

When previous evidence identifies a component, researchers may predefine a limited analysis. For example, a well-characterized event-related potential (ERP), such as the mismatch negativity or P300, may have an expected electrode and time window. Researchers can average activity in that predefined window and conduct a single test or an analysis of variance (ANOVA), depending on the design.

A time-resolved analysis can instead test points within the time window. When the location and timing are not known in advance, researchers may search across a large sensor-by-time space, making correction for multiple comparisons essential.

A typical SPM analysis pipeline

A statistical parametric mapping (SPM) analysis can include the following steps:

  1. Begin with raw EEG or MEG data.

  2. Preprocess the data, for example by filtering or detecting artifacts.

  3. Convert each participant’s condition data into scalp maps over space and time. Related analyses can also be performed at source level.

  4. Apply spatial smoothing where required for the selected inferential approach.

  5. Fit a general linear model (GLM) at each spatial and temporal location.

  6. Use model coefficients to calculate contrasts of interest.

  7. Produce unthresholded statistical parametric maps, such as maps of ttt- or FFF-statistics.

  8. Conduct statistical inference using an appropriate correction or Bayesian model-comparison procedure.

The unthresholded map displays test statistics across the measurement space; further inference is needed to decide which patterns have sufficient support.

Classical correction: Gaussian random field theory

One frequentist option is Gaussian random field theory. It treats a statistical map as a smooth, continuous random field and uses its spatial and temporal structure to correct for multiple comparisons.

In simplified terms:

  • The map can be understood as having peaks, valleys, and spatially or temporally connected regions.

  • A threshold and correction procedure determine which peaks or clusters are unlikely under the null model.

  • The resulting family-wise-error-corrected map identifies regions that survive the correction.

The goal is to control the chance of obtaining one or more false positives across the family of tests, rather than interpreting every uncorrected pointwise result independently.

Bayesian model selection in SPM

SPM can also use Bayesian model selection. Instead of asking only whether a statistical map crosses a corrected threshold, researchers specify competing models that predict different patterns or condition effects.

Variational Bayesian methods approximate model evidence, allowing researchers to estimate the relative probability of candidate models at different locations and times. The model with the greatest probability can be identified, while maps can show where and when different models are favored.

Group-level comparison can use:

  • Fixed-effects analysis, which assumes that the same model applies across the group.

  • Random-effects analysis, which allows for the possibility that participants differ in which model best explains their data and is less dominated by the assumption of one common model.

Bayesian model selection can reveal spatial or temporal variation in support for competing explanations. It complements statistical maps by asking which specified model best accounts for the data, rather than only whether an effect is statistically significant.


9. EEG source reconstruction and sparse priors

The EEG inverse problem

EEG sensors record scalp-level electrical activity. Researchers often want to infer which brain sources produced it. The forward problem—predicting scalp data from specified sources and a head model—is comparatively direct. The inverse problem—recovering sources from scalp measurements—is difficult because many different combinations of source locations and activations can produce similar scalp patterns.

Source reconstruction therefore requires assumptions or constraints that reduce the space of plausible solutions.

Multiple sparse prior method

In SPM, a default Bayesian approach to source reconstruction is multiple sparse priors (MSP). At a high level, the method:

  1. Uses a head model and a forward operator, or lead-field matrix, to describe how candidate sources would appear at EEG sensors.

  2. Uses measured EEG data as the observations to be explained.

  3. Considers candidate source patches informed by anatomical assumptions.

  4. Represents candidate source patterns through prior covariance structures.

  5. Iteratively adjusts the contribution of candidate patches, reducing the weight of patches that do not help explain the data.

  6. Selects a source configuration that provides a good balance between explaining the data and its model evidence.

The result is a source estimate informed by both the measured data and the priors. Anatomical restrictions can also be applied when justified—for example, focusing a model on regions relevant to a visual or auditory task. Such restrictions should reflect a defensible scientific rationale, because they constrain the possible solution.


10. Interpreting Bayesian neuroimaging results

Neuroimaging conclusions are conditional on the model used. Bayesian analysis makes prior assumptions and uncertainty explicit, but it does not remove the need for scientific judgment.

Several cautions follow:

  • A posterior is conditional on the likelihood, priors, and model structure.

  • A model that fits data well among the candidates may still omit important mechanisms.

  • A prior can improve estimation, but an unjustified prior can bias conclusions.

  • Inverse problems remain underdetermined; priors help constrain them but do not create direct observations of latent brain processes.

  • More mechanistic claims can be more uncertain than purely descriptive claims because they depend on more assumptions.

  • Bayesian inference can test hypotheses about potential mechanisms, but those hypotheses may need evaluation using other datasets, measurement modalities, or more direct experimental methods.

Bayesian methods are an inferential framework, not a general solution to every scientific problem. The scientific question and the proposed mechanism should be formulated clearly before choosing an inferential method.


11. Getting started with Bayesian neuroimaging

Two practical paths can help researchers begin learning Bayesian methods:

  • Translate a familiar analysis into a Bayesian version. For example, a researcher already using frequentist correction in SPM can explore the Bayesian alternative. Comparing approaches can build intuition while drawing on existing knowledge of the data and workflow.

  • Learn the fundamentals directly. Studying Bayes’ rule, priors, likelihoods, posteriors, and model evidence provides a foundation for understanding different applications.

Useful learning resources include tutorials and documentation for SPM, the Variational Bayesian Analysis toolbox wiki, and introductory Bayesian lectures and textbooks such as Statistical Rethinking. For neuroimaging models, simulation-based practice is particularly valuable: it tests whether a model can recover known parameters and whether its assumptions lead to sensible inference.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent