Matlab Precedures for 
"Business Cycle Implications of Internal Consumption Habits for New Keynesin Models"
by Takashi Kano (Department of Economics, Hitotsubashi University)
and James M Nason (Research Deparment, Federal Reserve Bank of Philadelphia)

======================================================================================
Warnings: The procedures call BACC (Bayesian Analysis, Computation and Comunication by 
John Geweke) to implement Bayesian VAR posterior simulations. Chris Sims's solver of 
linear rational expecations model is also need to simulate NKMBC models.

======================================================================================

Directory Structure
-------------------
mainpath/func/                  Various Matlab procedures
mainpath/spec0/                 BVAR results
              /info1/             [DlnY DlnP] information set
                    /VAR2           lag 2
                    /VAR4           lag 4
              /info2/             [DlnC DlnP] information set
                    /VAR2           lag 2  
                    /VAR4           lag 4 
        /spec1/habitprior.mat    NKMBC with AR money growth rule  
              /info1/              [DlnY DlnP] information set
                    /VAR2/          lag2
                         /habit        with habit
              /info2/              [DlnC DlnP] information set
                    /VAR2/          lag2  
                         /habit        with habit
        /spec2/habitprior.mat    NKMBC with AR money growth rule and flexible price (S-Wage) 
              /info1/              [DlnY DlnP] information set
                    /VAR2/          lag2
                         /habit        with habit
              /info2/              [DlnC DlnP] information set
                    /VAR2/          lag2  
                         /habit        with habit
        /spec3/habitprior.mat    NKMBC with AR money growth rule and flexible wage (S-Price) 
              /info1/              [DlnY DlnP] information set
                    /VAR2/          lag2
                         /habit        with habit
              /info2/              [DlnC DlnP] information set
                    /VAR2/          lag2  
                         /habit        with habit
       /spec4/habitprior.mat     NKMBC with Taylor rule  
              /info1/              [DlnY DlnP] information set
                    /VAR2/          lag2
                         /habit        with habit
              /info2/              [DlnC DlnP] information set
                    /VAR2/          lag2  
                         /habit        with habit
       /spec5/habitprior.mat     NKMBC with Taylor rule and flexible price (S-Wage) 
              /info1/              [DlnY DlnP] information set
                    /VAR2/          lag2
                         /habit        with habit
              /info2/              [DlnC DlnP] information set
                    /VAR2/          lag2  
                         /habit        with habit
       /spec6/habitprior.mat     NKMBC with Taylor rule and flexible wage (S-Price)  
              /info1/              [DlnY DlnP] information set
                    /VAR2/          lag2
                         /habit        with habit
              /info2/              [DlnC DlnP] information set
                    /VAR2/          lag2  
                         /habit        with habit

NKMBC specifications
--------------------
   mspec = 1: NKMBC with AR money growth  
         = 2; NKMBC with AR money growth and flexible price (S-Wage)
         = 3; NKMBC with AR money growth and flexible wage (S-Price)
         = 4; NKMBC with Taylor rule
         = 5; NKMBC with Taylor rule and flexible price (S-Wage)
         = 6: NKMBC with Taylor rule and flexible wage (S-Price)


Specification File
------------------
pathspec.m:      Specify the main working directory 

Data File
---------
kn_data.dat:     ASCII data file

NKMBC prior file
----------------
habitprior.mat:  Prior specification for NKMBC models

Various Matlab Procedures
-------------------------
knsst.m:         Calculating the steady states of NKMBC models calling runssn.m
knsolve2.m:      Computing the solution of the solution of the linearized NKMBC models
                 Calling Chris Sims's RE solver gensys.m
kn_priordraw.m:  Drawing random samples from prior densities for the structural parameters 
                    of NKMBC models  
kn_artdraw.m:    Drawing artificial data from NKMBC models

 

Bayesian estimation of VAR with BACC
------------------------------------
kn_bvar.m:       Bayesian VAR posterior simulation by BACC
kn_sampleirf.m:  Calculating empirical SDs from BVAR output


NKMBC model simulation
----------------------
kn_priorsim.m:   Drawing the structural parameters from the prior distributions
kn_modelsim.m:   Monte Carlo simulation of NKMBC models
kn_ks_sd_ar_p.m: Calculating KS statistics and reporting CICs of permanent SDs for NKMBC with MGR rule
kn_ks_sd_ar_t.m: Calculating KS statistics and reporting CICs of transitory SDs for NKMBC with MGR rule
kn_ks_sd_tr_p.m: Calculating KS statistics and reporting CICs of permanent SDs for NKMBC with TR rule
kn_ks_sd_tr_t.m: Calculating KS statistics and reporting CICs of transitory SDs for NKMBC with MGR rule


Plotting figures 2,3,4,5
----------------------
figure2.m:              Plotting figure 2 of empirical SDs
figure3_baseline.m:     Plotting figure 3 for baseline model
figure4_sticky_price.m: Plotting figure 4 for sticky price model
figure5_sticky_wage.m:  Plotting figure 5 for sticky wage model
