Psych216A: Statistics and data analysis in MATLAB (Spring 2012)

News

  • Class is finished!

Lectures

1. Probability distributions and error bars
     Lecture video | Lecture notes | Lecture slides | MATLAB tutorial| Homework | HW Solutions

2. Hypothesis testing and correlation
     Lecture video | Lecture notes | Lecture slides | MATLAB tutorial (utility: Shuffle.m) | Homework | HW Solutions

3. Model specification
     Lecture video | Lecture notes| Lecture slides | MATLAB tutorial | Homework | HW Solutions

4. Model fitting
     Lecture video | Lecture notes | Lecture slides | MATLAB tutorial | Homework | HW Solutions
          Extra tutorial on dot products

5. Model accuracy
     Lecture video | Lecture notes | Lecture slides | MATLAB tutorial | Homework | HW Solutions

6. Model reliability
     Lecture video | Lecture notes | Lecture slides | MATLAB tutorial (utility: randnmulti.m) | Homework | HW Solutions

7. [Discussion questions]
     Lecture notes

8. Classification
     Lecture video | Lecture notes | Lecture slides | MATLAB tutorial | Homework | HW Solutions

9. [Real-world examples]
     Lecture video | MATLAB transcript

10. [Final project presentations]
     Description of assignment

Final Projects

Congratulations to the students for doing a great job!

Basic Information

Classes: Tuesdays, 2:15pm – 5:05pm, Lane History Corner (Bldg. 200), Room 205
Instructor: Kendrick Kay, PhD, knk@stanford.edu, office hours: Thu, 10–11am, Jordan 482
Co-instructor: Jason Yeatman, jyeatman@stanford.edu, office hours: Thu, 2–3pm, Jordan 480
Co-instructor: Franco Pestilli, PhD, frk@stanford.edu, office hours: Mon, 10–11am, Jordan 480
Faculty supervisor: Professor Brian Wandell, PhD

This course will cover basic statistical principles that are widely useful for the analysis of neuroscience and behavioral data, such as error bars and confidence intervals, multivariate probability distributions, regression and classification, linear and nonlinear models, cross-validation, bootstrapping, and model selection. In each class, we will cover the theory behind a statistical principle and learn how to implement the principle efficiently in MATLAB. Example material can be found at http://randomanalyses.blogspot.com. Prerequisites: Familiarity with basic statistics and programming in MATLAB.

Course Description (PDF)

Overview: The goal of this course is to (1) identify and explain basic statistical principles that are widely applicable to the analysis of neuroscience and behavioral data and (2) show how these principles can be translated into practice. We will use MATLAB as the programming environment, emphasizing good coding practices (code generality, code documentation, code efficiency). Topics will include probability distributions, error bars and confidence intervals, statistical significance, regression, classification, correlation, linear and nonlinear models, cross-validation, bootstrapping, model selection, and randomization methods, and may also include regularization methods (ridge regression, lasso) and unsupervised learning (PCA, ICA, k-means). We will focus on nonparametric and computational approaches to statistical problems, as opposed to classical statistical approaches involving parametric assumptions and analytic solutions. In each class we will cover the theory behind a particular statistical principle and learn how to implement the principle efficiently and effectively in MATLAB.

 

Target audience: This course is intended for graduate students who would like to gain a better understanding of basic statistical principles and who are interested in implementing and exploring different ways to analyze data. Auditors (e.g. postdocs) are welcome.

 

Prerequisites: Students should have some familiarity with basic statistics and with programming in MATLAB.

 

Assignments: There will be weekly assignments consisting of a few conceptual questions that can be answered in a few sentences and a short programming task. There will also be a final project in which each student will write on a statistical or data analysis issue that was not covered in class (examples: rank-order correlation, Bonferroni correction, circular statistics, non-Gaussian noise, coherence, etc.). Ideally the issue should be of personal interest to the student. The write-up should explain the relevant theory and principles and then present MATLAB code that demonstrates the principles. Assignments can be completed in groups of up to two people.

 

Material: The material covered in the class will roughly follow the content that is being developed at http://randomanalyses.blogspot.com.

 

Textbook (optional, but a useful resource): The Elements of Statistical Learning by Trevor Hastie, Robert Tibshirani, and Jerome Friedman.

 

Final grade:

  Homework assignments = 50%

  Final project = 50%

Syllabus (PDF)

Date

Topic

Homework

April 3

Lecture 1. Probability distributions and error bars (histograms, mean, standard deviation, median, probability distributions, the Gaussian distribution, error bars, confidence intervals, bootstrapping)

April 10

Lecture 2. Hypothesis testing and correlation (hypothesis testing, p-values, t-test and nonparametric alternatives, correlation (r), independence)

HW1 due April 13

April 17

Lecture 3. Model specification (regression vs. classification, linear models, linearized models, nonlinear models)

HW2 due April 20

April 24

Lecture 4. Model fitting (least-squares, error surfaces, nonlinear optimization, maximum likelihood)

HW3 due April 27

May 1

Lecture 5. Model accuracy (coefficient of determination (R2), overfitting, cross-validation, model selection)

HW4 due May 4

May 8

Lecture 6. Model reliability (bootstrapping, jackknifing, split-half)

HW5 due May 11

May 15

Lecture 7. [Discussion questions]

HW6 due May 18

May 22

Lecture 8. Classification (logistic regression, linear discriminant analysis, support vector machines, nearest-neighbor classification)

---

May 29

Lecture 9. [Real-world examples]

HW8 due June 1

June 5

Lecture 10. [Final project presentations]

Final project due

If you are working with a partner, please indicate the partner’s name on your homework. Homework should be saved as a PDF file and e-mailed to Jason Yeatman (jyeatman@stanford.edu). Answers to each homework will be posted shortly after the due date.

The final project consists of a write-up (see Course Description) and an informal presentation of the results (10-15 minutes) on the last day of class.