Skip to content

Instantly share code, notes, and snippets.

View ksauka's full-sized avatar
🎯
Focusing

Sauka ksauka

🎯
Focusing
  • Hogeschool Van Amsterdam
  • Netherlands
  • X @KSauka
View GitHub Profile
@ksauka
ksauka / Dynamic Fixed Effects Panel Data Model.ipynb
Created December 22, 2021 07:03 — forked from spillz/Dynamic Fixed Effects Panel Data Model.ipynb
Demonstrate dynamic panel data estimation using IV in linearmodels
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
with pm.Model() as hierarchical_model:
# global model parameters
α_μ_tmp = pm.Normal('α_μ_tmp', mu=0., sd=100)
α_σ_tmp = pm.HalfNormal('α_σ_tmp', 5.)
β_μ = pm.Normal('β_μ', mu=0., sd=100)
β_σ = pm.HalfNormal('β_σ', 5.)
# train type specific model parameters
α_tmp = pm.Normal('α_tmp', mu=α_μ_tmp, sd=α_σ_tmp, shape=n_train_types)
# Intercept for each train type, distributed around train type mean