/* habit .prg. Simulates constantinides style habit */ output file = habit.out reset; library pgraph; bet = 0.98; thet = 0.95; Dc = 1.01; /* steady state values */ eta = 2; Dc1 = 1.01; /* size of one day higher consumption growth */ Rf = 1/(bet*dc^(-eta)); " bet" bet; "thet" thet; " dc" dc; " eta" eta; ""; " Rf" rf; /* check that basic foc is satisfied */ test = (dc-thet)^(-eta) + bet*thet*dc^(-eta)*(dc-thet)^(-eta) - bet*rf*(dc-thet)^(-eta)*dc^(-eta) - bet^2*rf*thet*(dc-thet)^(-eta)*dc^(-2*eta); if abs(test) >= 1E-12 ; "error in foc. " test " should be zero"; endif; /* find sequence of interest rates to clear market */ Rfv = (dc-thet)^(-eta) - bet*thet*dc^(-eta)*(dc-thet)^(-eta); Rfv = Rfv/(bet*(dc-thet)^(-eta)*dc^(-eta) - bet^(2)*thet*(dc-thet)^(-eta)*dc^(-eta)*dc^(-eta) ); /* now do dates around intervention */ /* at intervention Rfn = (dc-thet)^(-eta) - bet*thet*dc^(-eta)*(dc-thet)^(-eta); Rfn = Rfv/(bet*(dc-thet)^(-eta)*dc^(-eta) - bet^(2)*thet*(dc-thet)^(-eta)*dc^(-eta)*dc^(-eta) ); output off;