Larger-scale projects

(Julia) Fast, “Robust,” and Approximately Correct (FRAC) Demand Estimation

Description: I have written a first version of a Julia package to estimate mixed logit demand models (e.g. BLP) via the approximate method developed by Salanie and Wolak (2019). This method provides estimates of workhorse IO demand models orders of magnitude faster than standard estimation methods. The code is posted to Github here, and the repository contains instructions for installation and use.

(Matlab/Julia) Nonparametric Demand Estimation

Julia Description: I am currently writing a Julia package called NPDemand.jl, hosted on Github here, which estimates structural demand functions nonparametrically following Compiani (2020). The current code can select the strongest substitutes for each product and divide products into (potentially overlapping) subgroups of strong substitutes following these selection patterns. It can then estimate demand on each subgroup and calculate price elasticities at realized or counterfactual prices.

Matlab Description: This is my Matlab implementation of the nonparametric demand estimator developed by Giovanni Compiani. The code estimates demand and calculates price elasticities. The zip file includes README.pdf, which explains how my implementation differs from the code Giovanni has written himself (posted on his website). This file is written under the assumption that the reader has read Compiani 2019 in detail. This Matlab implementation is being replaced by the Julia package above.

(Stata) Dynamic Panel Estimation with a Nonlinear Markov Process

Description: This repository contains a simple example of the estimator I introduce in my working paper “Estimating Productivity and Markups Under Imperfect Competition.” The file cobbDouglasExample.do simulates a dynamic panel model analogous to standard production function data with endogenous inputs and a productivity shock which evolves according to a quadratic first-order Markov process. _panelpf.ado contains programs to estimate the production function and Markov process parameters from this data.

Smaller-scale (Gists, single-file examples)

(Julia) FKRB estimator for mixed logit demand

Description: This is a gist where I simulate mixed logit data and apply a simple implementation of the Fox, Kim, Ryan, Bajari (2011), using a non-negative elastic net improvement introduced by Heiss et. al (2019). The code was written with eventual packaging in mind, so it includes many un-used options and more structure than is necessary for a single implementation. Hopefully it demonstrates the structure well enough for others to implement more complicated versions.

(Julia) Turing.jl examples

Description: Just for fun, I tried my hand at two exercises in Bayesian modeling/estimation using Turing.jl and posted both as Gists. The first is a simple implementation of linear Bayesian IV regression, and the second is a longer file in which I tried to build up to estimating BLP via MCMC. The file includes a few different iterations of demand estimation with market-level data, starting with a logit model with measurement error and building up to BLP. Either or both may have errors and may be updated if I find good uses for applying this code that requires full testing.