new; /**********************************************************************************************************/ /**********************************************************************************************************/ /* GAUSS code for steady-state wealth ratio computation based on ECM consumption function */ /* */ /* by Gabor Vadas */ /* http://vadasg.extra.hu */ /**********************************************************************************************************/ /* Detailed description: Vadas, G. (2007) 'WEALTH PORTFOLIO OF HUNGARIAN HOUSEHOLDS - URBAN LEGENDS */ /* AND FACTS', MNB Occasional Paper No. 68., November 2007, National Bank of Hungary */ /* */ /**********************************************************************************************************/ /**********************************************************************************************************/ /* Please declare whether the following model is estimated on quarterly data */ /* ========================================================================= */ d_type = 1; /* 1: quarterly, 0: yearly */ /* Please enter the parameters of housing investment to gross savings equations */ /* ============================================================================ */ /* */ /* eta = exp(PI_1+PI_2*(g_ph - r))/(1+exp(PI_1+PI_2*(g_ph - r))) */ PI_1 = 0.22; PI_2 = 3.2; /* Please enter the set of annual income growth rate: PDI = (1+g)*PDI(-1) */ /* ====================================================================== */ g = {0.01, 0.02, 0.03, 0.04}; /* Please enter the annual depreciation rate of housing (1-szig) */ /* ============================================================= */ szig = 0.01; /* Consumption ECM with financial wealh only */ /* ========================================= */ /* */ /* dlog(C) = -B0*[log(C(-1)) - alpha_0 - alpha_1*log(PDI(-1)) - alpha_2*log(HFW(-1))] + short run dinamics */ /* where alpha_1 + alpha_2 = 1 */ alpha_0f = -0.603; alpha_2f = 0.337; /* Consumption ECM with financial and housing wealh */ /* ================================================ */ /* */ /* dlog(C) = -B0*[log(C(-1)) - alpha_0 - alpha_1*log(PDI(-1)) - alpha_2*log(HFW(-1)) - alpha_3*log(HHW(-1))] */ /* + short run dinamics */ /* where alpha_1 + alpha_2 + alpha_3 = 1 */ alpha_0fh = -0.879; alpha_2fh = 0.234; alpha_3fh = 0.146; /**********************************************************************************************************/ /**********************************************************************************************************/ /* Main program starts here */ /* Do not modify */ /**********************************************************************************************************/ /**********************************************************************************************************/ cls; omega_ff = zeros(rows(g),1); omega_fh = zeros(rows(g),1); s_f = zeros(rows(g),1); hi_f = zeros(rows(g),1); omega_hf = zeros(rows(g),1); omega_hh = zeros(rows(g),1); s_h = zeros(rows(g),1); hi_h = zeros(rows(g),1); ss = szig; r = 0.00; if d_type eq 1; gg = (1+g).^(1/4)-1; szig = (1+szig)^(1/4)-1; rr = (1+r).^(1/4)-1; endif; i = 1; do while i le rows(g); eta = exp(PI_1+PI_2*gg[i])/(1+EXP(PI_1+PI_2*gg[i])); eqSolveset; _eqs_MaxIters = 1000; __output = 0; start = 4; {omega_tmp,tcode } = eqSolve(&Ff,start); omega_ff[i] = omega_tmp; gamma_f = 1-gg[i]/eta*omega_tmp; s_f[i] = (1 - gamma_f)*100*eta; omega_fh[i] = omega_tmp*(1-eta)/eta*gg[i]/(szig*(1+gg[i])); hi_f[i] = (1 - gamma_f)*100*(1-eta); i = i + 1; endo; i = 1; do while i le rows(g); eta = exp(PI_1+PI_2*gg[i])/(1+EXP(PI_1+PI_2*gg[i])); eqSolveset; _eqs_MaxIters = 1000; __output = 0; start = 4; {omega_tmp,tcode } = eqSolve(&Ffh,start); omega_hf[i] = omega_tmp; gamma_h = 1-gg[i]/eta*omega_tmp; s_h[i] = (1 - gamma_h)*100*eta; omega_hh[i] = omega_tmp*(1-eta)/eta*gg[i]/(szig*(1+gg[i])); hi_h[i] = (1 - gamma_h)*100*(1-eta); i = i + 1; endo; format /mat/rd 9,2; print " Equilibrium wealth ratios at annual dep. rate = " ss; print " =================================================================================================="; print " Financial wealth only in cons. ECM Financial and housing wealth in cons. ECM" ; print " g ------------------------------------------ -------------------------------------------"; print " HFW/PDI NFS/PDI HHW/PDI HI/PDI HFW/PDI NFS/PDI HHW/PDI HI/PDI"; print " --------------------------------------------------------------------------------------------------"; format /mat/rd 10,1; print (g*100)~omega_ff*25~s_f~omega_fh*25~hi_f~omega_hf*25~s_h~omega_hh*25~hi_h; print " =================================================================================================="; print " Results in percentage point"; proc Ff(om); local f1; f1 = exp(alpha_0f)*om^(alpha_2f) + (gg[i]-rr)/(1-eta)*om-1; retp(f1); endp; proc Ffh(om); local f2; f2 = exp(alpha_0fh)*(eta/(1-eta))^(alpha_3fh)*((gg[i]-rr)/(szig))^(alpha_3fh)*om^(alpha_2fh+alpha_3fh) + (gg[i]-rr)/(1-eta)*om-1; retp(f2); endp;