ECON 21410: Computational Methods for Economics (2014)

This course introduces the empirical and computational techniques necessary for numerical estimation and simulation in economics. Through examples in economics, the course covers topics such as optimization, function approximation, and monte carlo techniques. Emphasis will be placed on developing effective programming and research practices. The course is structured through a series of applications in topics such as segregation, occupational choice, and repeated games. The course will be taught in R. Though helpful, no previous experience with R is required.

ECON 21410: Computational Methods for Economics (2015)

This course introduces the empirical and computational techniques necessary for numerical estimation and simulation in economics. Through examples in economics, the course covers topics such as optimization, function approximation, and monte carlo techniques. Emphasis will be placed on developing effective programming and research practices. The course is structured through a series of applications in topics such as segregation, occupational choice, and repeated games. The course will be taught in R. Though helpful, no previous experience with R is required.

Class Syllabus

  • Here

  • Problem Sets

  • Problem Set 1, (solution), (code)
  • Problem Set 2, (code for pset2), (solution), (code)
  • Problem Set 3, (solution), (code)
  • Problem Set 4
  • Problem Set 5, (solution), (code)
  • Problem Set 6, (data)
  • Problem Set 7

  • Class Examples

  • Example knitr file that calls outside code: example.Rnw , example.R , example.pdf
  • Example Schelling Segregation Model: example_schelling.R
  • Examples of nleqslv, optimize, and optim: example_nleqslv.R
  • Examples of regression, data summary, and function approximation: example_workingWithData.R
  • Examples of Maximum Likelihood Estimation: example_mle.R
  • Examples of Numerical Integration: example_integration.R
  • Examples of Apply: example_apply_commands.R
  • Examples of dplyr: example_dplyr.R
  • Examples of a random coefficients model (includes parallel and cpp implementation): example_randomCoefficients.R , example_randomCoefficients.cpp ,

  • Additional Course Files

  • Software Overview
  • Basic Operations in R
  • Segregation slides from class
  • Housing slides from class

  • Additional files and help are also on our github page here.

    Econ 61800: Practical Computing for Economists (2014)

    This colloquium covers the computer tools and programming techniques to implement and test economic ideas and theories quantitatively. It is more of an “engineering” than a “theory” course, focusing on the practical – working on problems and solutions. The goal is not only to provide students with an introduction to two valuable programming languages (R and C++) but also to introduce good programming, data, and project management techniques.

    The class syllabus can be downloaded Here

    Class Examples

  • Rapid Intro To R: code
  • Working with Data in R: code
  • Writing Programs in R: code
  • MCMC Factor Analysis in R: code
  • Econ 61800: Practical Computing for Economists (2015)

    This colloquium covers the computer tools and programming techniques to implement and test economic ideas and theories quantitatively. It is more of an “engineering” than a “theory” course, focusing on the practical – working on problems and solutions. The goal is not only to provide students with an introduction to two valuable programming languages (R and C++) but also to introduce good programming, data, and project management techniques.

    Class Examples

  • An Applied Introduction to R: code
  • Working with Functions in R: code
  • Econ 61800: Practical Computing for Economists (2016)

    This colloquium covers the computer tools and programming techniques to implement and test economic ideas and theories quantitatively. It is more of an “engineering” than a “theory” course, focusing on the practical – working on problems and solutions. The goal is not only to provide students with an introduction to a number of valuable programming languages, but also to introduce good programming, data, and project management techniques.

    Class Examples

  • Day 1: code
  • Day 2: code
  • Day 3: R , faster R , C++ for faster R , R and C++ basics , R and Armadillo basics
  • Economic REU: Microeconomics with R (2014 - 2017)

    This will be an interactive session covering R basics and standard programming techniques in R. Students should bring their computers to participate if possible.Comparisons will be drawn between R, Stata, and Matlab. Using the tools covered in the previous session in the second session will live-code a simulation of Schelling's Segregation model. This will cover control flow, random number generation, matrix manipulation, functions, proper coding etiquette, and plotting in R.

    Please install R and Rstudio and run this code prior to arrival (code).

    Files from Past Years (including Stata intro): Stata code | Stata data | CPI data | R code

    Teaching Experience

    • Teaching 2014

      Computational Methods in Economics

      University of Chicago (B.A.)

    • Teaching 2015

      Computational Methods in Economics

      University of Chicago (B.A.)

    • Teaching 2014

      Practical Computing for Economists

      University of Chicago (co-teaching, Ph.D.)

    • Teaching 2015

      Practical Computing for Economists

      University of Chicago (co-teaching, Ph.D.)

    • Teaching 2016

      Practical Computing for Economists

      University of Chicago (co-teaching, Ph.D.)

    • Teaching 2014

      Economic REU: Microeconomics with R

      University of Chicago (co-teaching, B.A.)

    • Teaching 2015

      Economic REU: Microeconomics with R

      University of Chicago (co-teaching, B.A.)

    • Teaching 2016

      Economic REU: Microeconomics with R

      University of Chicago (co-teaching, B.A.)

    • Teaching 2017

      Economic REU: Microeconomics with R

      University of Chicago (co-teaching, B.A.)

    • Teaching 2018

      Econometrics and Data Science

      Yale University (teaching, B.A.)

    • Teaching 2019

      Data Analysis and Econometrics

      Yale University (teaching, B.A.)

    • Teaching 2020(s)

      Data Analysis and Econometrics

      Yale University (teaching, B.A.)

    • Teaching 2020(f)

      Data Analysis and Econometrics

      Yale University (teaching, B.A.)

    T.A. Experience

    • T.A. 2013

      Price Theory I

      University of Chicago (Becker and Murphy; Ph.D.)

    • T.A. 2014

      Price Theory II

      University of Chicago (Becker and Murphy; Ph.D.)

    • T.A. 2014

      Price Theory I

      University of Chicago (Murphy; Ph.D.)

    • T.A. 2014

      Microeconomics

      Booth Graduate School of Business (Gibbs; Exec. MBA)

    • T.A. 2014

      Microeconomics

      Booth Graduate School of Business (Stole; Exec. MBA)

    • Precept. 2016

      Honors Workshop in Economics

      University of Chicago (Lima and Tsiang; B.A.)