AAEC6564 Bayesian Econometric Analysis

Klaus Moeltner | Department of Agricultural and Applied Economics | Virginia Tech | phone: (540) 231-8249 | fax: (540) 231-7417 | e-mail: moeltner@vt.edu
Home | Department | College | VT Home

Welcome to our course web site. New material will be added as we move along. Anything below the "In Progress" line is subject to change and edits.

Syllabus and General Announcements

  1. Syllabus (pdf)
  2. LaTeX material for syllabus (for your LaTEX practice, so you can see the underlying code)

    1. Main TeX file (tex)
    2. Bibilography (bib)
    3. Table with schedule(called by the main script) (tex)

Software Instructions

We will be using Matlab as our statistical programming package and LaTeX for word processing. Matlab will be available on the PCs in the computer lab in HUTCHESON 323-A.

The following instructions will guide you through downloading and installing LaTeX for Windows.

  1. Folder environment

    1. Instructions (pdf)
    2. Instructions (tex)

  2. Installing and customizing LateX for Windows

    1. Instructions (pdf)
    2. Instructions (tex)
    3. testscript (tex),(pdf - the finished result if all goes well)

  3. Installing new packages in LaTeX

    1. Instructions (pdf)
    2. Instructions (tex)

Textbook Websites

Koop, Poirier & Tobias 2007 (website)

 

Course Content

Module 1: Introduction to Bayesian Inference

Bayesian vs. Classical Estimation / Bayesian Model Components

  • Lecture Notes (pdf)(tex)(bib)
  • Matlab Material
    • mod1s1a (m)
    • mod1s1apublished (pdf)(tex)(m

Conjugate analysis

  • Univariate example (pdf)(tex)
  • Lecture Notes (pdf)(tex)
  • Matlab Material
    • igPlots (m)
    • mod1s2a(m)
    • mod2s2b(m)

Module 2: Gibbs Sampling

  • Lecture Notes (pdf)
  • Matlab Material
    • mod2s1a(m)
    • mod2_convergence_plots (m)
    • mod2_convergence_plots2 (m)
    • mod2_plots (m)
    • mod2_application(m)
    • mod2_blocking (m)
    • mod2_ac_plots (m)
    • mod2_convergence_plots3 (m)
    • mod2_wetlands (m)
    • mod2_wetlands2 (m)
    • mod2_wetlands_plot (m)

      functions:

    • gs_normal_independent (m)
    • gs_normal_independent_keepall (m)
    • klausdiagnostics (m)
    • klausdiagnostics_greater0(m)
    • gs_normal_blocked (m)
    • gs_normal_blocked_keepall(m)

      data:

    • labordata (txt)
    • wetlands (txt)

Common Bayesian Estimation "Tricks" (work in progress)

 

Module 3: Coverage and Prediction in Bayesian Analysis

  • Lecture Notes (pdf)
  • Matlab Material
    • mod3_hpdi (m)
    • mod3_wage_prediction (m)
    • mod3_ppp (m)

      functions:

    • klaus_hpdi (m)

Module 4: Models with General Error Structure / Model Comparison

  • Lecture Notes (pdf)
  • Matlab Material
    • mod4_data (m)
    • mod4_sur (m)
    • mod4_outage (m)
    • mod4_outage_hpdi (m)
    • mod4_sddr (m)
    • mod4_outage_sddr (m)
    • mod4_sur_chib (m)

      functions:

    • gs_sur (m)
    • gs_sur_chib (m)
    • var_vec (m) [coverts variance matrix into vector of unique elements]
    • vec_var (m) [reverse operation of var_vec]
    • invgampdf (m)

      data:

    • outage (txt)

Module 5: Data Augmentation / Latent Variable Models

  • Lecture Notes (pdf)
  • Matlab Material
    • mod5_probit_data (m)
    • mod5_probit (m)
    • mod5_probit_Fair (m)
    • mod5_probit_Fair_predict (m)
    • mod5_tobit_data (m)
    • mod5_tobit (m)
    • mod5_tobit_adoption (m)
    • mod5_tobit_adoption_predict (m)
    • mod5_tobit_adoption_naive (m)
    • mod5_tobit_adoption_naive_predict (m)

      functions:

    • gs_probit (m)
    • gs_tobit (m)
    • iwishpdf (m)
    • tnormrnd (m)
    • tnormpdf (m)

      data:

    • Fair_data (txt)
    • adoption (txt)

 

Module 6: Hierarchical Models

  • Lecture Notes (pdf)
  • Matlab Material
    • mod6_data (m)
    • mod6_HNRM_v1 (m)
    • mod6_HNRM_v2 (m)
    • mod6_HNRM_outage (m)
    • mod6_HNRM_outage_chib(m)
    • mod6_HNRM_outage_nocovs (m)
    • mod6_HNRM_outage_nocovs_chib (m)
    • mod6_HNRM_outage_predict (m)

      functions:

    • gs_HNRM_v1 (m)
    • gs_HNRM_v2 (m)
    • gs_HNRM_chib (m)
    • gs_HNRM_nocovs (m)
    • gs_HNRM_nocovs_chib (m)

      data:

    • outage_50firms (txt)

 

Module 7: Metropolis-Hastings Algorithm

  • Lecture Notes (pdf)
  • Matlab Material
    • mod7_Poisson_data (m)
    • mod7_Poisson_rwc_prep (m)
    • mod7_Poisson_rwc (m)
    • mod7_Poisson_ic (m)
    • mod7_Poisson_rwc_ACPlots (m)
    • mod7_Poisson_ic_ACPlots (m)
    • mod7_Poisson_mudsnail_ic (m)
    • mod7_HP_mudsnail (m)
    • mod7_HP_Mudsnail_parallel (m)

    • mod7_HP_mudsnail (log file .txt)
    • mod7_HP_mudsnail_parallel (log file .txt)

      functions:

    • gs_Poisson_rwc (m)
    • gs_Poisson_ic (m)
    • gs_HP (m)
    • gs_HPpar(m)
    • Poisson_beta_mle (m)
    • HP_beta_mle (m)
    • HP_gi_mle (m)
    • mvtpdf_klaus (m)

      data:

    • TCWfishing (.mat)

 

Module 8: Bayesian Model Search and Model Averaging

  • Lecture Notes (pdf)(tex)
  • Matlab Material
    • mod8_SSVS_data (m)
    • mod8_SSVS (m)
    • mod8_SSVS_modProb (m)
    • mod8_SSVS_fishing_data (m)
    • mod8_SSVS_fishing (m)
    • mod8_SSVS_fishing_modProb (m)
    • mod8_SSVS_fishing_BMA (m)
    • mod8_MC3 (m)
    • mod8_MC3_modProb (m)
    • mod8_MC3_convTest (m)
    • mod8_MC3_growth (m)
    • mod8_MC3_growth_modProb (m)
    • mod8_MC3_growth_convTest (m)
    • growth log file (.txt)
    • growth model probabilities log file (.txt)
    • growth model convergence test log (.txt)

      functions:

    • gs_SSVS (m)
    • gs_SSVS_fishing (m)
    • graycode (m) (utility function to generate binary 0/1 patterns)
    • gs_MC3 (m)

      data:

    • fishdata (.mat)(.txt)
    • growth data (.txt)

 

Module 9: Selection, Treatment, and Switching Models

  • Lecture Notes (pdf)
  • Matlab Material
    • mod9_select_data (m)
    • mod9_select (m)
    • mod9_select_door2door (m)
    • mod9_treat_data (m)
    • mod9_treat (m)
    • mod9_treat_naive (m)
    • mod9_treatJobTrain (m)
    • mod9_treatJobTrainNaive (m)
    • mod9_switch_data (m)
    • mod9_switch (m)
    • select log (.txt)
    • select door2door log (.txt)
    • treat log (.txt)
    • JobTrain log (.txt)
    • JobTrainNaive log (.txt)
    • switch log (.txt)

      functions:

    • gs_select (m)
    • gs_treat (m)
    • gs_switch (m)
    • iw_sig11 (m) (utility function to draw from a constrained IW)

 

Module 10: Finite Mixture Models

  • Lecture Notes (pdf)(.tex)
  • Matlab Material
    • mod10_2CMM_data (m)
    • mod10_2CMMln (m)
    • mod10_2CMMchi2 (m)
    • mod10_2CMMmix (m)
    • mod10_2CMMplots (m)
    • mod10_fmrm_data (m)
    • mod10_fmrm_data_v2 (m)
    • mod10_fmrm (m)
    • mod10_fmrm_v2 (m)

      functions:

    • gs_2cmm (m)
    • gs_fmrm (m)
    • dirrnd (m)

    logs:

    • mod10_2CCMmix (.txt)
    • mod10_fmrm (.txt)
    • mod10_fmrm_v2 (.txt)

Module 11: Re-parameterized Models: Ordered Probit & Hierarchical Ordered Probit

  • Lecture Notes (pdf)
  • Matlab Material
    • mod11_data (m)
    • mod11_op (m)
    • mod11_op_paddlers (m)
    • mod11_op_paddlers_predict (m)
    • mod11_HOP_Pac (m)
    • mod11_HOP_Mag (m)
    • mod11_HOP_Car (m)
    • mod11_HOP_Pac_postest (m)
    • mod11_HOP_Mag_postest (m)
    • mod11_HOP_Car_postest (m)
    • mod11_HOP_graphs (m)

      functions:

    • gs_OP (m)
    • gs_HOP_normal (m)

    logs:

    • mod11_HOP_Pac (.txt)
    • mod11_HOP_Mag (.txt)
    • mod11_HOP_Car (.txt)
    • mod11_HOP_Pac_postest (.txt)
    • mod11_HOP_Mag_postest (.txt)
    • mod11_HOP_Car_postest (.txt)

 

Module 12: Gibbs-within-Gibbs: Multinomial Probit Models

  • Lecture Notes (pdf)
  • Matlab Material
    • mod12_MNP_I_data (m)
    • mod12_MNP_I (m)

      functions:

    • GwG (m)
    • tnormrnd_robert_single (m)
    • tnormrnd (m)
    • gs_MNP_I (m)

    logs:

    • mod12_MNP_I (.txt)

 

Module 13: Repeated discrete choice: Multivariate Probit with identified variance matrix

  • Gibbs sampler details, basic model (pdf)
  • Gibbs sampler details, endogeneity model ("recursive probit") (pdf)

  • Presentation slides, basic model (pdf)
  • Presentation slides, endogenous model ("recursive probit") (pdf)

  • Presentation slides, random thresholds model (pdf)
  • Matlab Material
    • mod13_nimby (m)
    • mod13_nimby_predictWTP (m)
    • mod13_nimby_marginals (m)
    • mod13_nimby_marginalsCombine (m)
    • mod13_RTM_prep (m)
    • mod13_RTM (m)
    • mod13_RTM_postest (m)

      functions:

    • gs_nimby (m)
    • gs_RTM (m)

     

Module 14: Importance sampling, Accept-reject sampling

  • Lecture notes (pdf)
  • Matlab Material
    • mod14_IS (m)
    • mod14_AR (m)
    • mod14_AR2 (m)

      functions:

    • trnd_klaus (m)
    • tpdf_klaus (m)

In progress
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

 

 

Problem Sets

  • PS1 (pdf)(tex) - due Feb. 11

  • PS2 (pdf) - due Mar. 3

  • PS3 (pdf) - due Mar. 24
  • door2door (txt)

  • PS4 (pdf)(tex) - due Apr. 14

  • PS5 (pdf)(tex) - due May 3
    • waterdays500 (txt)

  • Final exam (pdf)(tex) - due May 11