Math 50 Linear regression modeling

Unit 0

Prerequisite material

These are things I will not cover in class, but you should know:

  • Calculus: You should know how to take derivatives and integrals of polynomial and exponential functions. I won’t ask you to calculate an integral on the exam, but it will be important for understanding a few derivations I perform in class.
  • Plotting: Know how to interpret plots on a log scale, contour plots, histograms, and boxplots.
  • Basic linear algebra: Some familiarity will be helpful to understand concepts starting in Unit 3:
    • Basic operations: Matrix-vector, matrix-matrix multiplication and addition
    • Matrix inversion: I won’t ask you to calculate any matrix inverses by hand, but you will need to know what it means You do not need to know about eigenvalues and eigenvectors. I will introduce these concepts as needed how. I will not ask any exam questions that require you to do linear algebra calculations.
  • Coding fundamentals: You should be comfortable with for loops, while loops, if statements (not necessarily in Python), and the meaning of the equals sign in coding vs. math. If you come from R, you may have used <-, but in Python we use = to assign variables.

Some things I will cover in class are:

  • Working with numpy arrays.
  • Working with pandas DataFrames (loading CSVs, selecting columns, summarizing data).
  • How to use numpy.random to generate samples.

That said, it’s helpful to review these beforehand, especially if you have limited experience coding.

Resources for coding

If you are new to Python, I recommend spending an hour or two going through a short tutorial.

  • Official Python tutorial (control flow, functions):
    https://docs.python.org/3/tutorial/

  • NumPy basics (arrays, indexing, random draws):
    • Absolute beginner’s guide: https://numpy.org/doc/stable/user/absolute_beginners.html
    • Indexing and slicing: https://numpy.org/doc/stable/user/basics.indexing.html
  • pandas (skim only for now):
    https://pandas.pydata.org/docs/getting_started/

If you want more interactive practice: