\(\newcommand{L}[1]{\| #1 \|}\newcommand{VL}[1]{\L{ \vec{#1} }}\newcommand{R}[1]{\operatorname{Re}\,(#1)}\newcommand{I}[1]{\operatorname{Im}\, (#1)}\)
Exploring the general linear model¶
Python path¶
stimuli.py
file;test_stimuli.py
file;mkdir code mv stimuli.py code
Install pytest if you haven’t got it already:
pip install pytest
Show that the tests don’t work yet:
py.test test_stimuli.py
Set Python path;
Finally:
mv test_stimuli.py code py.test code/test_stimuli.py
Simple and multiple regression¶
finish going through the introduction to the General Linear Model;
we get the same results in R:
psychopathy = c(11.416, 4.514, 12.204, 14.835, 8.416, 6.563, 17.343, 13.02, 15.19 , 11.902, 22.721, 22.324) clammy = c(0.389, 0.2 , 0.241, 0.463, 4.585, 1.097, 1.642, 4.972, 7.957, 5.585, 5.527, 6.964) res = lm(psychopathy ~ clammy) print(summary(res))
on matrix rank;
Correlation again¶
- Make sure you have
stimuli.py
andpearson.py
on your Python path. (pearson.py
comes from the exercise in Pearson 1D and 2D function exercise); - Correlation per voxel, in 2D.
Reading and homework for next week¶
- Finish the Least-squares regression exercise – see GLM exercise, with some github practice;
- Do preliminary work on projects to prepare for project pitch next week.