Introduction

Welcome to the course!

This is Psychology 9040: Scientific Computing, for Jan-Apr 2024.

đź’» Bring your computer to class! We will be writing code. đź’»

Course Goals

In this one-semester graduate course you will learn skills in scientific computing—tools and techniques that you can use in your own research. You will learn to program using Python, MATLAB or R, which are high-level programming languages with many libraries that provide a rich ecosystem for scientific computing. If you want to use a different language in the course you are welcome to.

As much as I can I will teach concepts in a way that are language-agnostic. I will probably use Python and sometimes MATLAB to demonstrate concepts in class, but you can use any language you want for your assignments. I would like this course to be less of “how to use MATLAB” or “how to use Python” and more of “how to program your computer using a language of your choice”.

The course is designed to achieve three primary goals:

  1. You will learn to write code in a high-level language
  2. You will learn to think computationally and algorithmically about data analysis
  3. You will learn some common data analysis techniques, which will give you a foundation from which to learn more complex scientific computing skills to suit your own research goals

Topics

In the first part of the course you will learn how to write code. The topics we will cover are common to any high-level language including Python, MATLAB, R, Javascript, C, Julia, Go, Swift, etc. All high level languages have things like numbers, strings, arrays, loops, if-statements. Languages differ in their syntax, in the names of common functions, and sometimes in some other subtle ways (e.g. passing by reference vs passing by value) but otherwise, all high-level languages basically work in the same way. Learning these fundamental concepts of high-level programming languages using one language will enable you to learn other languages as well in the future.

The other aspect of programming that you will learn is how to think algorithmically about solving problems and completing tasks with computers. In general there are two reasons to use a computer to perform a given task, (1) because the task would take too long by hand (e.g. churning through processing a huge amount of data), and (2) because the computer can do something clever that you cannot do yourself (e.g. applying complex algorithms to a dataset).

In learning the fundamentals of high-level programming languages (data types, loops, conditionals, etc) we will be learning to write code to solve little toy problems. This will start to teach you how to think algorithmically about writing code. Think about it like learning to play a musical instrument. You don’t start by learining to play Beethoven. You start learning basic skills by playing scales, arpeggios, different key signatures, etc. Building up basic skills using toy problems is a convenient path towards using coding skills to solve real-world programming problems in the context of your own thesis research.

Fundamentals

  • digital representation of data
  • basic data types, operators, & expressions
  • control flow & conditionals
  • functions
  • complex data types
  • file input & output
  • graphical displays of data

Other Topics

In the second part of the course we will learn about a set of topics that we agree upon as a class is of interest to us. We will decide on these in the first week or two of the course. These may include:

  • sampling, signal processing, & filtering data
  • logic of frequentist statistics
  • a few common statistical tests
  • fitting models to data
  • optimization & gradient descent
  • simulating dynamical systems
  • some basics of machine learning and/or neural networks
  • intro to writing scientific documents using LaTeX, Quarto, pandoc/markdown, etc.
  • principles of code organization, version control, and workflow for reproducible research

By building upon the foundational knowledge and skills you have acquired in this course, you will be able to learn more complex techniques in programming and in data analysis as your scientific research progresses.

First Reading