Lecture 0: Portfolio Selection and a First Look at the Course#
Lecture 0 is a preview. It is meant to feel like a real first lecture, so that you can decide whether this is the computing course you want to take. If you missed it, the recording and this chapter cover the same ground, and Homework 0 lets you try everything yourself.
Objectives#
Understand what this course is, who it is for, and how it differs from the program’s other computing courses. The course map says who the course is for and shows the job postings behind the skills it teaches.
See what firms ask for: the same argument as the course map, made from a few thousand job postings across 64 firms rather than ten hand-picked ones.
Take a tour of the course: this textbook, the course’s GitHub organization, the discussion board, and a few projects from past quarters.
Get set up. In particular, apply for your WRDS account today, because approval takes a few days.
Clone a repository and run it. See what a
requirements.txtfile does and why it is the first step toward a reproducible result.Work through the week’s paper, Markowitz (1952), in the portfolio selection notebook, using real stock returns from CRSP. The mean-variance problem has a closed-form solution until you forbid short sales, and then it does not. The appendix derives the formulas.
Take a tour of the data that we will use this quarter.
In class#
Who am I, and what is this course? Walk through the course map: who the course is for, the job postings behind its skills, and the schedule of papers.
Tour the textbook, the GitHub organization, and the discussion board.
Clone HW 0, create the
finmenvironment, install fromrequirements.txt, rundoit, and launch the dashboard.Portfolio selection: returns are linear in the portfolio weights, and risk is not. Work through the notebook and the dashboard together.
No short sales: one inequality constraint, and the formula is gone. Solve it numerically and compare the two frontiers.
Where did the data come from? Read
pull_crsp.py, then see WRDS live.The catch: the optimizer is an “error maximizer.” Why that makes reproducibility a research problem and not only an engineering one.
Move the notebook’s logic into tested functions and watch the tests pass on GitHub Actions. This is Homework 0.
Homework 0#
HW 0 is ungraded. It sets up your computer and your accounts for the rest of the quarter, and it walks you through the full cycle that every later homework repeats: clone, install, run, edit, test, push.