Skip to content

Introduction and Overview

stevenjluck edited this page Sep 11, 2023 · 3 revisions

Multivariate pattern analysis (MVPA) methods have been applied to fMRI data for over 20 years to analyze the pattern of BOLD activity across voxels. The first MVPA method that was applied to fMRI data was pattern classification or decoding. A more recent MVPA approach is representational similarity analysis (RSA). Both of these methods can also be applied to ERP data, examining the pattern of voltage across electrode sites rather than the pattern of activity across voxels. Although scalp ERPs have poorer spatial resolution than fMRI, ERPs work surprisingly well for many MVPA applications.

This tutorial describes how ERPLAB implements pattern classification (which is known more informally as “decoding”). To distinguish this from other types of MVPA, we refer to decoding as multivariate pattern classification or MVPC. ERPLAB currently has a very simple but easy-to-use implementation of MVPC. Our goal is to make basic decoding methods readily available to all ERP researchers. We call this “decoding for everyone”.

The data we’ll be using in this tutorial come from the study of Bae (2021) and can be downloaded at https://doi.org/10.18115/D5KS6S. For the sake of simplicity, we’ll be looking at the data from only the first five participants in this study.

Because most ERP researchers have little or no prior decoding experience, this tutorial provides a fairly detailed overview of how decoding works in general, with special emphasis on the technical details that you must understand to use the ERPLAB decoding tools effectively and avoid common errors. To preview, there are three important principles of decoding that you must keep in mind:

  • Principle 1- If you are comparing the decoding accuracy across different time periods, across different experimental conditions, or across different groups of subjects, any differences in noise level could produce differences in decoding accuracy.
  • Principle 2- Differences in the number of trials across experimental conditions or groups of participants will cause differences in decoding accuracy between conditions or groups. It is usually necessary to equate the number of trials across groups and conditions.
  • Principle 3- When you are training a decoder to distinguish between different classes (e.g., different stimuli), differences between classes in trial-to-trial variability or in the number of trials will artificially inflate the decoding accuracy. It is therefore necessary to equate the number of trials used for decoding across classes. These principles will be described in detail later in this tutorial.

Required Software and Background Knowledge

Before starting this tutorial, it is very important that you have all of the required software components. This includes the latest version of ERPLAB (version 10.0 or higher), which you can download from https://github.com/ucdavis/erplab/releases. The download page indicates that you need v2020 or higher of Matlab along with some specific Matlab toolboxes, including the Statistics and Machine Learning Toolbox. You must obtain these toolboxes from Matlab if you do not already have them. If you don’t know how to do that, contact your local IT support team. If you don’t know what toolboxes are installed, you can go to the Matlab Command Window and type ver (followed by enter/return). In addition, you must have v2023.1 or higher of EEGLAB. At the time I am writing this, v2023.1 is still not an official version release of EEGLAB, so you would need to either wait for v2023.1 to be released or download the development version of EEGLAB here: https://github.com/sccn/eeglab.

Clone this wiki locally