Code

This page contains code and data for a number of the figures in the book. This code uses a mixture of different programs, including MATLAB (.m), R (.R), python (.py), and unix shell scripts (.sh). In addition, some examples include data, and are provided as gzipped tar archives (.tgz).

Note that in many cases the code does not create the figure exactly as printed; there may have been further editing of the images to create the final figures. However, this code should in general demonstrate the principles underlying the figures.

Prerequisites:

MATLAB

    • Several programs require spm_hrf() from the SPM package

    • Several programs require the MATLAB Statistics Toolbox

    • Figure 8.4 requires the FastICA package for MATLAB

R

    • Several programs require the matlab package for R

    • Figure 8.11 requires the sna and WGCNA packages for R

    • Figure 9.2/9.3 require the e1071 and randomForest packages for R