Post on Bayesian IV

Just in case anyone is interested, I have put together a short post on implementing an instrumental variables (IV) model with hierarchical priors in Stan. Comments welcome; would like to turn it into a case study.



Thanks. That’s already a case study! All we need is a license to distribute and an open-source license for the code and we’d be happy to put it up with the rest of the case studies.

1 Like

Awesome case study, thank you @James_Savage ! I learned a lot!

Just wondering, shouldn’t it be

mu[:,1] = rep_vector(alpha[1], N) + append_col(X_exog, Z)*append_row(Gamma, Delta);

instead of

mu[:,1] = rep_vector(alpha[1], N) + append_col(X_exog, Z)*append_row(Delta, Gamma);

in the Stan file classic_iv_hierarchical_prior.stan. I think for your particular prior choices (which in particular is equal for Delta and Gamma) it doesn’t matter if you are solely concerned with beta_ours, but I think the interpretation of corresponding components of Delta and Gamma might be swapped?

Hi–is this in the Case Studies page on the Stan website? I didn’t see it, but maybe I’m looking in the wrong place?

@andrewgelman I didn’t respond to Bob’s request for a license and permission. How do I do that @Bob_Carpenter?

Just add licenses for code and text to the case study itself. I’d recommend new BSD and CC BY NC. Then I can post it. Good timing as I need to review a couple more case study proposals today.

You’re right! Good catch. Hopefully @richard_mcelreath spotted the error too!