Larger-scale projects

(R) dbreg (Database regressions)

Description: I’ve started contributing to dbreg, a package for running fast regressions on very large datasets, especially when many fixed effects need to be estimated. The package is in early stages but is already faster than the popular fixest on some very large regressions.

(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: My coauthor and I created Julia package called NPDemand.jl, hosted on Github here, which estimates structural demand functions nonparametrically following Brand and Smith (2025). This package allows users to specify nonparametric models of demand, specify economic constraints they wish to be satisfied by the results, estimate that model and calculate price elasticities or counterfactuals, all in a few lines of code.

Matlab Description: This is my much older Matlab implementation of the nonparametric demand estimator developed by Compiani (2020). 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 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.