Document Type


Publication Date






URL with Digital Object Identifier



© 2019 The Authors This technical note describes a variational or Bayesian implementation of representational similarity analysis (RSA) and pattern component modelling (PCM). It considers RSA and PCM as Bayesian model comparison procedures that assess the evidence for stimulus or condition-specific patterns of responses distributed over voxels or channels. On this view, one can use standard variational inference procedures to quantify the contributions of particular patterns to the data, by evaluating second-order parameters or hyperparameters. Crucially, this allows one to use parametric empirical Bayes (PEB) to infer which patterns are consistent among subjects. At the between-subject level, one can then assess the evidence for different (combinations of) hypotheses about condition-specific effects using Bayesian model comparison. Alternatively, one can select a single hypothesis that best explains the pattern of responses using Bayesian model selection. This note rehearses the technical aspects of within and between-subject RSA using a worked example, as implemented in the Statistical Parametric Mapping (SPM) software. En route, we highlight the connection between univariate and multivariate analyses of neuroimaging data and the sorts of analyses that are possible using component modelling and representational similarity analysis.


© 2019 The Authors. Published by Elsevier Inc. This is an open access article under the CC BY license (

This article was originally published as

Friston, K. J., Diedrichsen, J., Holmes, E., & Zeidman, P. (2019). Variational representational similarity analysis. NeuroImage, 201, 115986. DOI:

Creative Commons License

Creative Commons Attribution 4.0 License
This work is licensed under a Creative Commons Attribution 4.0 License.