Originally given as a tutorial at NeuroHackademy 2020 by Alex Huth.
In this tutorial you'll learn about three different linear regression methods: ordinary least squares, ridge regression, and Tikhonov regression. The tutorial explores these methods both theoretically and practically, since each is used to fit encoding models that predict fMRI responses to natural language stimuli.
This tutorial has three parts:
1_tikhonov_tutorial.ipynb
- this part covers ordinary least squares (OLS) and introduces the fMRI encoding analysis2_tikhonov_tutorial.ipynb
- this part covers ridge regression3_tikhonov_tutorial.ipynb
- this part covers Tikhonov regression
The fMRI data used in this tutorial was collected by Alex Huth and Wendy de Heer at the University of California, Berkeley. Much of the theory work was done with Anwar Nunez. All work was supervised by professors Jack Gallant and Frederic Theunissen of the UC Berkeley Psychology Department. Visualization is done using pycortex.
The analysis demonstrated in this tutorial forms the basis of these two papers:
- Nunez-Elizalde, A. O. et al., "Voxelwise encoding models with non-spherical multivariate normal priors" (2019) NeuroImage.
- Huth, A. G. et al., "Natural speech reveals the semantic maps that tile human cerebral cortex" (2016) Nature.
There are two ways you can run this tutorial. If you want to go through the materials on your own machine, please follow the instructions below:
On Linux
- (If not using Anaconda) install dependencies:
sudo apt-get update
sudo apt-get install -y ipython ipython-notebook python-numpy python-scipy python-matplotlib cython python-pip python-pip python-dev python-h5py python-nibabel python-lxml python-shapely python-html5lib python-tables git pycortex
- Start a Jupyter notebook server in this directory (if you don't already have one):
jupyter notebook
OR
git clone https://github.com/alexhuth/TikhonovTutorial
cd TikhonovTutorial
pip install -r requirements.txt
jupyter notebook
If you want to run it interactively in your browser without the necessity to install the dependencies, please check this binder instance:
The necessary fMRI data will be downloaded and unarchived in the first tutorial notebook, so make sure you run that before the others!