Commit 91ca605e authored by Thomas Brand's avatar Thomas Brand

Initial commit.

parent f34ee076
"period","DE_tauc","DE_tauk","DE_taun","DE_tauwf","DE_tauwh","EA_tauc","EA_tauk","EA_taun","EA_tauwf","EA_tauwh","ES_tauc","ES_tauk","ES_taun","ES_tauwf","ES_tauwh","FR_tauc","FR_tauk","FR_taun","FR_tauwf","FR_tauwh","IT_tauc","IT_tauk","IT_taun","IT_tauwf","IT_tauwh"
1995,0.188,0.568,0.131,0.137,0.123,0.189,0.454,0.115,0.17,0.099,0.136,0.35,0.1,0.164,0.039,0.218,0.367,0.059,0.234,0.108,0.173,0.522,0.152,0.212,0.062
1996,0.183,0.567,0.119,0.139,0.126,0.189,0.455,0.113,0.177,0.1,0.139,0.35,0.105,0.164,0.039,0.223,0.367,0.062,0.232,0.109,0.171,0.532,0.153,0.251,0.064
1997,0.181,0.567,0.12,0.143,0.131,0.19,0.463,0.113,0.179,0.1,0.142,0.35,0.093,0.164,0.037,0.224,0.417,0.066,0.234,0.102,0.173,0.532,0.155,0.255,0.066
1998,0.184,0.56,0.122,0.142,0.13,0.192,0.436,0.119,0.176,0.091,0.15,0.35,0.094,0.167,0.038,0.222,0.417,0.091,0.231,0.074,0.178,0.412,0.16,0.227,0.064
1999,0.192,0.516,0.123,0.14,0.127,0.196,0.419,0.12,0.175,0.092,0.156,0.35,0.088,0.17,0.038,0.223,0.4,0.093,0.232,0.075,0.179,0.412,0.167,0.223,0.067
2000,0.191,0.516,0.129,0.137,0.125,0.192,0.412,0.122,0.173,0.089,0.153,0.35,0.089,0.172,0.039,0.21,0.378,0.091,0.227,0.075,0.177,0.412,0.169,0.218,0.058
2001,0.188,0.382,0.128,0.137,0.125,0.188,0.369,0.121,0.173,0.088,0.149,0.35,0.093,0.177,0.039,0.203,0.364,0.094,0.224,0.074,0.173,0.402,0.159,0.218,0.059
2002,0.188,0.382,0.126,0.137,0.124,0.189,0.363,0.119,0.173,0.087,0.148,0.35,0.097,0.177,0.039,0.204,0.354,0.088,0.224,0.075,0.173,0.402,0.156,0.218,0.059
2003,0.188,0.396,0.124,0.14,0.126,0.188,0.36,0.116,0.174,0.088,0.154,0.35,0.09,0.178,0.039,0.202,0.354,0.089,0.227,0.076,0.168,0.382,0.15,0.221,0.057
2004,0.184,0.382,0.116,0.138,0.125,0.189,0.352,0.114,0.173,0.088,0.158,0.35,0.093,0.179,0.039,0.203,0.354,0.088,0.226,0.075,0.171,0.372,0.148,0.222,0.057
2005,0.182,0.387,0.112,0.136,0.126,0.19,0.346,0.113,0.172,0.087,0.163,0.35,0.095,0.179,0.039,0.203,0.35,0.089,0.228,0.076,0.171,0.372,0.146,0.218,0.056
2006,0.183,0.387,0.119,0.135,0.126,0.191,0.342,0.115,0.171,0.088,0.162,0.35,0.097,0.18,0.041,0.201,0.344,0.087,0.23,0.077,0.176,0.372,0.149,0.212,0.055
2007,0.197,0.387,0.124,0.132,0.124,0.193,0.335,0.119,0.173,0.087,0.155,0.325,0.105,0.178,0.039,0.197,0.344,0.086,0.229,0.076,0.174,0.372,0.154,0.223,0.058
2008,0.197,0.302,0.132,0.13,0.122,0.186,0.302,0.121,0.171,0.087,0.133,0.3,0.099,0.171,0.038,0.193,0.344,0.088,0.23,0.074,0.167,0.314,0.161,0.221,0.059
2009,0.199,0.302,0.128,0.129,0.121,0.182,0.302,0.117,0.171,0.085,0.112,0.3,0.093,0.165,0.037,0.19,0.344,0.083,0.231,0.074,0.166,0.314,0.154,0.225,0.06
2010,0.196,0.302,0.119,0.13,0.121,0.188,0.3,0.114,0.173,0.086,0.138,0.3,0.1,0.166,0.038,0.192,0.344,0.077,0.235,0.072,0.174,0.314,0.155,0.225,0.059
2011,0.2,0.302,0.119,0.13,0.123,0.19,0.302,0.116,0.173,0.087,0.134,0.3,0.103,0.168,0.038,0.198,0.361,0.079,0.239,0.073,0.175,0.314,0.153,0.223,0.058
2012,0.198,0.302,0.123,0.129,0.123,0.191,0.302,0.122,0.174,0.088,0.135,0.3,0.11,0.168,0.036,0.2,0.361,0.088,0.241,0.074,0.18,0.313,0.164,0.223,0.057
2013,0.202,0.302,0.126,0.129,0.122,0.194,0.307,0.123,0.175,0.089,0.15,0.3,0.11,0.169,0.034,0.201,0.38,0.089,0.244,0.076,0.177,0.313,0.164,0.222,0.062
2014,0.204,0.302,0.127,0.129,0.122,0.197,0.306,0.123,0.175,0.09,0.153,0.3,0.109,0.173,0.037,0.205,0.38,0.089,0.246,0.077,0.182,0.313,0.164,0.221,0.06
2015,0.205,0.302,0.13,0.129,0.123,0.2,0.303,0.124,0.174,0.09,0.16,0.28,0.101,0.17,0.036,0.209,0.38,0.089,0.245,0.078,0.181,0.313,0.165,0.22,0.061
2016,0.205,0.302,0.13,0.129,0.125,0.202,0.292,0.123,0.173,0.091,0.16,0.25,0.1,0.172,0.037,0.21,0.344,0.089,0.243,0.08,0.184,0.313,0.162,0.215,0.06
This diff is collapsed.
shocks;
var TAUC_EXO; stderr 1;
var TAUN_EXO; stderr 1;
var TAUWH_EXO; stderr 1;
var TAUWF_EXO; stderr 1;
var TAULS_EXO; stderr 1;
var A_EXO; stderr 1;
var XIA_EXO; stderr 1;
var MU_EXO; stderr 1;
var ZETAI_EXO; stderr 1;
var EPS_EXO; stderr 1;
var EPSW_EXO; stderr 1;
var R_EXO; stderr 1;
var D_EXO; stderr 1;
var XIB_EXO; stderr 1;
var GC_EXO; stderr 1;
var GI_EXO; stderr 1;
var T_EXO; stderr 1;
var OTHGOV_EXO; stderr 1;
var SIGMA_EXO; stderr 1;
var GAMMAN_EXO; stderr 1;
var YW_EXO; stderr 1;
var POIL_EXO; stderr 1;
end;
EPSBAR=6;
EPSWBAR=4.3;
EPSMBAR=6;
EPSXBAR=6;
BBAR=2.2;
ZETAIBAR=1;
GAMMANBAR=0.985;
ng=0.75;
vartheta=2;
gammabw=0.01;
phi2=0.1;
tauo=0;
bigtheta=0.005;
signalcorr=0;
weONBAR=0.005;
beta=0.9971;
delta=0.04;
alpha=0.379;
ZBAR=1.012^.25;
PIBAR=1.013^.25;
MUBAR=1.00^.25;
LDBAR=0.928;
TOYDBAR=0.163;
GCOYDBAR=0.232;
GIOYDBAR=0.039;
OTHGOVOYDBAR=0.064;
UNEMPGOVOYDBAR=0.019;
IOYDBAR=0.219;
CMOYDBAR=0.18;
IMOYDBAR=0.088;
TAUCBAR=0.206;
TAUNBAR=0.084;
TAUWHBAR=0.080;
TAUWFBAR=0.233;
tauk=0.366;
QKONBAR=1.46;
var
C
CINDEX
LAMBDA
RENTK
Q
I
F1
F2
WSTAR
G1
G2
PISTAR
U
MC
W
R
B
T
LD
YD
L
VP
VW
K
KP
GAMMAPRC
GAMMAPRI
GAMMABW
GAMMAC
GAMMAI
GAMMAU
COSTI
EPS
EPSW
EPSM
EPSX
XIA
PCOP
PIOP
PIC
PII
Z
D
OTHGOV
GC
PI
TAUC
TAUN
TAUWH
TAUWF
TAULS
Y
KG
GI
TNR
TR
CNR
CR
PMOP
PXOPEX
GM1
GM2
PIMSTAR
GX1
GX2
PIXSTAR
EXBW
MCM
M
X
VM
VX
YM
YX
CM
IM
CD
ID
PIM
PIX
PWOPEX
POILOPEX
PIW
RW
YW
RK
GAMMAN
N
OMEGABAR
SIGMA
F
G
GAMMA
GAMMAPR
GPR
XIM
XIR
A
MU
XIB
XIBW
XIX
OMEGAC
OMEGAI
DELTAEX
TB
ZETAI
GOV
REVGDP
TOTGOVGDP
GOVGDP
BALGDP
PRIMBALGDP
CONSUMPTION_OBS $CONSUMPTION\_OBS$ (measure='%', long_name='Real consumption per capita')
GDP_OBS $GDP\_OBS$ (measure='%', long_name='Real GDP per capita')
HOURS_OBS $HOURS\_OBS$ (measure='level', long_name='Hours worked per capita')
INFLATION_OBS $INFLATION\_OBS$ (measure='%', long_name='GDP deflator')
INVESTMENT_OBS $INVESTMENT\_OBS$ (measure='%', long_name='Real investment per capita')
PINVEST_OBS $PINVEST\_OBS$ (measure='%', long_name='Real price of investment')
RE_OBS $RE\_OBS$ (measure='% APR', long_name='Short-term risk-free interest rate')
WAGE_OBS $WAGE\_OBS$ (measure='%', long_name='Real wage per capita')
CREDIT_OBS $CREDIT\_OBS$ (measure='%', long_name='Real credit per capita')
NETWORTH_OBS $NETWORTH\_OBS$ (measure='%', long_name='Real net worth per capita')
CREDITSPREAD_OBS $CREDITSPREAD\_OBS$ (measure='% APP', long_name='Credit spread')
GC_OBS $GOV\_OBS$ (measure='%', long_name='Government consumption per capita')
GI_OBS $GOV\_OBS$ (measure='%', long_name='Government investment per capita')
T_OBS $GOV\_OBS$ (measure='%', long_name='Government transfers per capita')
OTHGOV_OBS $GOV\_OBS$ (measure='%', long_name='Other government expenditures per capita')
B_OBS $B\_OBS$ (measure='level', long_name='Public debt')
TAUC_OBS $TAUC\_OBS$ (measure='level', long_name='Tax rate on consumption')
TAUN_OBS $TAUN\_OBS$ (measure='level', long_name='Tax rate on labour income')
TAUWH_OBS $TAUWH\_OBS$ (measure='level', long_name='Contribution rate to social security, by employees')
TAUWF_OBS $TAUWF\_OBS$ (measure='level', long_name='Contribution rate to social security, by employers')
YWORLD_OBS $YWORLD\_OBS$ (measure='%', long_name='Foreign demand')
POIL_OBS $OIL\_OBS$ (measure='%',long_name='Oil price')
;
omega, BETA_PDF, 0.5, 0.10;
iota, BETA_PDF, 0.5, 0.10;
epsk, BETA_PDF, 0.5, 0.10;
epsg, BETA_PDF, 0.5, 0.10;
h, BETA_PDF, 0.5, 0.05;
thetaw, BETA_PDF, 0.75, 0.05;
thetap, BETA_PDF, 0.75, 0.05;
thetax, BETA_PDF, 0.75, 0.05;
thetam, BETA_PDF, 0.75, 0.05;
chiw, BETA_PDF, 0.75, 0.1;
chip, BETA_PDF, 0.75, 0.1;
chix, BETA_PDF, 0.75, 0.1;
chim, BETA_PDF, 0.75, 0.1;
omegam, BETA_PDF, 0.15, 0.05;
epsc, GAMMA_PDF, 1.5, 0.25;
epsi, GAMMA_PDF, 1.5, 0.25;
epsw, GAMMA_PDF, 1.5, 0.25;
kappa, GAMMA_PDF, 4, 0.50;
gammac, GAMMA_PDF, 2.5, 1;
gammai, GAMMA_PDF, 2.5, 1;
gammapi, NORMAL_PDF, 1.7, 0.1;
gammay, BETA_PDF, 0.5, 0.2;
FBAR, BETA_PDF, 0.0075, 0.00375;
rhotauc, BETA_PDF, 0.75, 0.10;
rhotaun, BETA_PDF, 0.75, 0.10;
rhotauwh, BETA_PDF, 0.75, 0.10;
rhotauwf, BETA_PDF, 0.75, 0.10;
rhoyw, BETA_PDF, 0.75, 0.10;
rhopoil, BETA_PDF, 0.75, 0.10;
rhotauls, BETA_PDF, 0.75, 0.10;
rhoa, BETA_PDF, 0.75, 0.10;
rhoxia, BETA_PDF, 0.75, 0.10;
rhomu, BETA_PDF, 0.75, 0.10;
rhozetai, BETA_PDF, 0.75, 0.10;
rhoeps, BETA_PDF, 0.75, 0.10;
rhoepsw, BETA_PDF, 0.75, 0.10;
rhor, BETA_PDF, 0.75, 0.10;
rhod, BETA_PDF, 0.75, 0.10;
rhoxib, BETA_PDF, 0.75, 0.10;
rhosigma, BETA_PDF, 0.75, 0.10;
rhogc, BETA_PDF, 0.75, 0.10;
rhogi, BETA_PDF, 0.75, 0.10;
rhot, BETA_PDF, 0.75, 0.10;
rhoothgov, BETA_PDF, 0.75, 0.10;
rhogovy, BETA_PDF, 0.20, 0.10;
rhogovb, BETA_PDF, 0.02, 0.005;
sigtauc, UNIFORM_PDF,,, 0, 1;
sigtaun, UNIFORM_PDF,,, 0, 1;
sigtauwh, UNIFORM_PDF,,, 0, 1;
sigtauwf, UNIFORM_PDF,,, 0, 1;
sigtauls, UNIFORM_PDF,,, 0, 1;
siga, UNIFORM_PDF,,, 0, 1;
sigxia, UNIFORM_PDF,,, 0, 1;
sigmu, UNIFORM_PDF,,, 0, 1;
sigzetai, UNIFORM_PDF,,, 0, 1;
sigeps, UNIFORM_PDF,,, 0, 1;
sigepsw, UNIFORM_PDF,,, 0, 1;
sigr, UNIFORM_PDF,,, 0, 1;
sigd, UNIFORM_PDF,,, 0, 1;
sigxib, UNIFORM_PDF,,, 0, 1;
siggc, UNIFORM_PDF,,, 0, 1;
siggi, UNIFORM_PDF,,, 0, 1;
sigt, UNIFORM_PDF,,, 0, 1;
sigothgov, UNIFORM_PDF,,, 0, 1;
siggamman, UNIFORM_PDF,,, 0, 1;
sigsigma, UNIFORM_PDF,,, 0, 1;
sigyw, UNIFORM_PDF,,, 0, 1;
sigpoil, UNIFORM_PDF,,, 0, 1;
stderr NETWORTH_OBS, UNIFORM_PDF,,, 0, 1;
varexo
TAUC_EXO $\sigma_{\tau c}$ (long_name='Tax rate on consumption', measure='shock')
TAUN_EXO $\sigma_{\tau n}$ (long_name='Tax rate on labour income', measure='shock')
TAUWH_EXO $\sigma_{\tau wh}$ (long_name='Contribution rate to social security, by employees', measure='shock')
TAUWF_EXO $\sigma_{\tau wf}$ (long_name='Contribution rate to social security, by employers', measure='shock')
TAULS_EXO $\sigma_{\tau ls}$ (long_name='Lump-sum transfers', measure='shock')
A_EXO $\sigma_{a}$ (long_name='Persistent technology', measure='shock')
XIA_EXO $\sigma_{\xi a}$ (long_name='Temporary technology', measure='shock')
MU_EXO $\sigma_{\mu}$ (long_name='Investment price', measure='shock')
ZETAI_EXO $\sigma_{\zeta i}$ (long_name='Investment efficiency', measure='shock')
EPS_EXO $\sigma_{\epsilon}$ (long_name='Price markup', measure='shock')
EPSW_EXO $\sigma_{\epsilon w}$ (long_name='Wage markup', measure='shock')
R_EXO $\sigma_{r}$ (long_name='Monetary policy', measure='shock')
D_EXO $\sigma_{d}$ (long_name='Consumption preferences', measure='shock')
XIB_EXO $\sigma_{\xi b}$ (long_name='Government bond risk premium', measure='shock')
GC_EXO $\sigma_{gov}$ (long_name='Government consumption', measure='shock')
GI_EXO $\sigma_{gov}$ (long_name='Government investment', measure='shock')
T_EXO $\sigma_{gov}$ (long_name='Government transfers', measure='shock')
OTHGOV_EXO $\sigma_{gov}$ (long_name='Other government expenditures', measure='shock')
GAMMAN_EXO $\sigma_{\gamma n}$ (long_name='Equity', measure='shock')
SIGMA_EXO $\sigma_{\sigma}$ (long_name='Financial Risk', measure='shock')
YW_EXO $\sigma_{yw}$ (long_name='Foreign demand', measure='shock')
POIL_EXO $\sigma_{oil}$ (long_name='Oil price', measure='shock')
;
omega,0.246339 ;
iota,0.047163 ;
epsk,0.628839 ;
epsg,0.831057 ;
h,0.788468 ;
thetaw,0.853738 ;
thetap,0.928212 ;
thetax,0.704786 ;
thetam,0.795109 ;
chiw,0.777601 ;
chip,0.816131 ;
chix,0.485509 ;
chim,0.829567 ;
omegam,0.231603 ;
epsc,1.620552 ;
epsi,1.207665 ;
epsw,1.608774 ;
kappa,4.634848 ;
gammac,0.607623 ;
gammai,0.041558 ;
gammapi,1.836762 ;
gammay,0.914571 ;
FBAR,0.045172 ;
rhotauc,0.924168 ;
rhotaun,0.945049 ;
rhotauwh,0.970619 ;
rhotauwf,0.969713 ;
rhoyw,0.968192 ;
rhopoil,0.946596 ;
rhotauls,0.446402 ;
rhoa,0.831245 ;
rhoxia,0.989395 ;
rhomu,0.819468 ;
rhozetai,0.783780 ;
rhoeps,0.707782 ;
rhoepsw,0.887191 ;
rhor,0.904407 ;
rhod,0.998200 ;
rhoxib,0.507697 ;
rhosigma,0.977330 ;
rhogc,0.913500 ;
rhogi,0.950399 ;
rhot,0.898601 ;
rhoothgov,0.831812 ;
rhogovy,0.272846 ;
rhogovb,0.013973 ;
sigtauc,0.013128 ;
sigtaun,0.023948 ;
sigtauwh,0.007276 ;
sigtauwf,0.004677 ;
sigtauls,0.193894 ;
siga,0.002410 ;
sigxia,0.005777 ;
sigmu,0.003818 ;
sigzetai,0.005226 ;
sigeps,0.983089 ;
sigepsw,0.981257 ;
sigr,0.000759 ;
sigd,0.927816 ;
sigxib,0.043823 ;
siggc,0.001726 ;
siggi,0.013644 ;
sigt,0.006027 ;
sigothgov,0.027809 ;
siggamman,0.009592 ;
sigsigma,0.033674 ;
sigyw,0.015314 ;
sigpoil,0.150805 ;
// Load data in levels.
dataFRlevels = dseries('../../data/dataFR.csv');
// Remove the first observations (same starting date as in CMR) and rename the dseries object.
dataFR=dataFRlevels(1995Q1:dataFRlevels.dates(end));
// Compute quaterly growth factors.
dataFR{'[^(?!.*creditspread|re|debt|hours_pc).*$]'} = 1+dataFR{'[^(?!.*creditspread|re|debt|hours_pc).*$]'}.qgrowth() ;
// Compute quarterly rates.
dataFR{'@creditspread,re@'} = (1+dataFR{'@creditspread,re@'})^0.25 ;
// Rename the observed variables
dataFR = dataFR.rename('gdp_rpc', 'GDP_OBS');
dataFR = dataFR.rename('conso_rpc', 'CONSUMPTION_OBS');
dataFR = dataFR.rename('inves_rpc', 'INVESTMENT_OBS');
dataFR = dataFR.rename('defgdp', 'INFLATION_OBS');
dataFR = dataFR.rename('pinves_defl', 'PINVEST_OBS');
dataFR = dataFR.rename('hours_pc', 'HOURS_OBS');
dataFR = dataFR.rename('wage_rph', 'WAGE_OBS');
dataFR = dataFR.rename('re', 'RE_OBS');
dataFR = dataFR.rename('pubcons_rpc', 'GC_OBS');
dataFR = dataFR.rename('pubinves_rpc', 'GI_OBS');
dataFR = dataFR.rename('tfs_rpc', 'T_OBS');
dataFR = dataFR.rename('othgov_rpc', 'OTHGOV_OBS');
dataFR = dataFR.rename('debt', 'B_OBS');
dataFR = dataFR.rename('creditspread', 'CREDITSPREAD_OBS');
dataFR = dataFR.rename('loans_nfc_rpc', 'CREDIT_OBS');
dataFR = dataFR.rename('networth_rpc', 'NETWORTH_OBS');
dataFR = dataFR.rename('world_demand', 'YWORLD_OBS');
dataFR = dataFR.rename('oil_prices', 'POIL_OBS');
// Set subsample used to demean the dataFR
range = 1995Q2:2016Q4;
// Save the mean growth rate of raw dataFR
data_mean = struct;
data_mean.name = dataFR{'[^(?!.*B_OBS|HOURS_OBS).*$]'}.name;
data_mean.name = [data_mean.name; 'B_OBS'];
data_mean.name = [data_mean.name; 'HOURS_OBS'];
data_mean.name = [data_mean.name; 'TAUC_OBS'];
data_mean.name = [data_mean.name; 'TAUN_OBS'];
data_mean.name = [data_mean.name; 'TAUWF_OBS'];
data_mean.name = [data_mean.name; 'TAUWH_OBS'];
data_mean.values = dataFR{'[^(?!.*B_OBS|HOURS_OBS).*$]'}(range).mean(true)';
data_mean.values = [data_mean.values; dataFR{'B_OBS'}(range).mean(false)];
data_mean.values = [data_mean.values; dataFR{'HOURS_OBS'}(range).mean(false)];
data_mean.values = [data_mean.values; dataFRlevels{'tauc'}(range).mean(false)];
data_mean.values = [data_mean.values; dataFRlevels{'taun'}(range).mean(false)];
data_mean.values = [data_mean.values; dataFRlevels{'tauwf'}(range).mean(false)];
data_mean.values = [data_mean.values; dataFRlevels{'tauwh'}(range).mean(false)];
save('mean.mat', 'data_mean');
// Center the dataFR (with geometric mean for all variables except B_OBS and HOURS_OBS)
dataFR{'[^(?!.*B_OBS|HOURS_OBS).*$]'} = dataFR{'[^(?!.*B_OBS|HOURS_OBS).*$]'}/dataFR{'[^(?!.*B_OBS|HOURS_OBS).*$]'}(range).mean(true);
// Compute factor deviation to the arithmetic mean
dataFR{'B_OBS'} = dataFR{'B_OBS'}-2.20;
dataFR{'HOURS_OBS'} = dataFR{'HOURS_OBS'}/dataFR{'HOURS_OBS'}(range).mean(false);
dataFR{'TAUC_OBS'} = dataFRlevels{'tauc'};
dataFR{'TAUN_OBS'} = dataFRlevels{'taun'};
dataFR{'TAUWF_OBS'} = dataFRlevels{'tauwf'};
dataFR{'TAUWH_OBS'} = dataFRlevels{'tauwh'};
// Declare dataFR dseries as the sample for estimation
data(series=dataFR, first_obs=1995Q2, last_obs=2017Q4);
%
options=optimset('MaxFunEvals',10000,'MaxIter',1000, 'Display', 'off');
D=1;
XIR=0;
XIBW=1;
XIB=1;
XIM=1;
XIX=1;
XIA=1;
GAMMAC=0;
GAMMAI=0;
GAMMAU=0;
COSTI=0;
GAMMABW=0;
GAMMAX=0;
GAMMAPRC=0;
GAMMAPRI=0;
EPS=EPSBAR;
EPSW=EPSWBAR;
EPSM=EPSMBAR;
EPSX=EPSXBAR;
B=BBAR;
TAUC=TAUCBAR;
TAUN=TAUNBAR;
TAUWH=TAUWHBAR;
TAUWF=TAUWFBAR;
LD=LDBAR;
PI=PIBAR;
Z=ZBAR;
MU=MUBAR;
ZETAI=ZETAIBAR;
A=Z^(1-alpha)*MU^(-alpha);
R=PI*Z/beta;
RW=R;
PIW=PI;
EXBW=0;
TB=0;
DELTAEX=1;
PWOPEX=1;
U=1;
OMEGAC=1;
OMEGAI=1;
PIC=PI;
PII=PI;
PIM=PI;
PIX=PI;
PISTAR=1;
PIMSTAR=1;
PIXSTAR=1;
VX=1;
VM=1;
VP=1;
POILOPEX=1;
MCM=1;
PXOPEX=EPSX/(EPSX-1);
PMOP=EPSM/(EPSM-1);
KGOYDBAR = GIOYDBAR/(1-(1-delta)/(Z*MU));
KPOYDBAR = IOYDBAR/(1-(1-delta)/(Z*MU));
fun = @(fa) [ ...
fa(1)-((1-IMOYDBAR/IOYDBAR*(PMOP/fa(1))^(epsi))+(1-(1-IMOYDBAR/IOYDBAR*(PMOP/fa(1))^(epsi)))*PMOP^(1-epsi))^(1/(1-epsi))
];
[fasol, fval, exitflag] = fsolve(fun,[1.03], options);
if exitflag<1
disp('First Newton failed!')
info = 1;
return
end
PIOP=fasol(1);
ni = (1-IMOYDBAR/IOYDBAR*(PMOP/PIOP)^(epsi));
Q=PIOP;
qkOn=QKONBAR;
weOn=weONBAR;
GAMMAN = GAMMANBAR;
F=FBAR;
NORMINVF=norminv(F);
GAMMAPR=(1-F);
fun = @(fa) [ ...
(1-(exp(fa(3)*NORMINVF-fa(3)^2/2)*(1-F)+(normcdf((log(exp(fa(3)*NORMINVF-fa(3)^2/2))+fa(3)^2/2)/fa(3)-fa(3)))))*fa(2)/R+GAMMAPR/(GAMMAPR-fa(1)*(1/(sqrt(2*3.14159265359)*fa(3))*exp(-0.5*((log(exp(fa(3)*NORMINVF-fa(3)^2/2))+fa(3)^2/2)/fa(3))^2)))*(fa(2)/R*((exp(fa(3)*NORMINVF-fa(3)^2/2)*(1-F)+(normcdf((log(exp(fa(3)*NORMINVF-fa(3)^2/2))+fa(3)^2/2)/fa(3)-fa(3))))-fa(1)*(normcdf((log(exp(fa(3)*NORMINVF-fa(3)^2/2))+fa(3)^2/2)/fa(3)-fa(3))))-1),...
qkOn*fa(2)/R*((1-fa(1))*(normcdf((log(exp(fa(3)*NORMINVF-fa(3)^2/2))+fa(3)^2/2)/fa(3)-fa(3)))+exp(fa(3)*NORMINVF-fa(3)^2/2)*(1-F))-qkOn+1,...
1-(GAMMAN/(PI*Z)*(fa(2)-R-fa(1)*(normcdf((log(exp(fa(3)*NORMINVF-fa(3)^2/2))+fa(3)^2/2)/fa(3)-fa(3)))*fa(2))*qkOn+weOn+GAMMAN*R/(PI*Z))
];
[fasol, fval, exitflag] = fsolve(fun,[0.2,1.03,0.4], options);
if exitflag<1
disp('Second Newton failed!')
info = 1;
return
end
mu=fasol(1);
RK=fasol(2);
SIGMA=fasol(3);
OMEGABAR=exp(SIGMA*NORMINVF-SIGMA^2/2);
G=(normcdf((log(OMEGABAR)+SIGMA^2/2)/SIGMA-SIGMA));
GAMMA=(OMEGABAR*(1-F)+G);
GPR=(1/(sqrt(2*3.14159265359)*SIGMA)*exp(-0.5*((log(OMEGABAR)+SIGMA^2/2)/SIGMA)^2));
RENTK=(Q*RK*(Z*MU/PI)-(1-delta)*Q-PIOP*delta*tauk)/(1-tauk);
phi1 = RENTK/PIOP;
MC=(EPS-1)/EPS;
phiOyd = (EPS/(EPS-1)-1)*VP;
fun = @(fa) [ ...
(A/Z*((fa(2)^(1/epsk)*KPOYDBAR^((epsk-1)/epsk)+(1-fa(2))^(1/epsk)*KGOYDBAR^((epsk-1)/epsk))^(epsk/(epsk-1)))^alpha*LD^(1-alpha)/(1+phiOyd))^(1/(1-alpha))*((fa(2)^(1/epsk)*KPOYDBAR^((epsk-1)/epsk)+(1-fa(2))^(1/epsk)*KGOYDBAR^((epsk-1)/epsk))^(epsk/(epsk-1)))^((epsk-1)/epsk)/LD*(KPOYDBAR/fa(2))^(1/epsk)-alpha/(1-alpha)*(1+TAUWF)*fa(1)/RENTK*Z*MU ,...
MC-(1/(1-alpha))^(1-alpha)*(1/alpha)^alpha*((1+TAUWF)*fa(1))^(1-alpha)*RENTK^alpha*(KPOYDBAR/(fa(2)*((fa(2)^(1/epsk)*KPOYDBAR^((epsk-1)/epsk)+(1-fa(2))^(1/epsk)*KGOYDBAR^((epsk-1)/epsk))^(epsk/(epsk-1)))))^(alpha/epsk)
];
[fasol, fval, exitflag] = fsolve(fun,[1.3,0.7], options);
if exitflag<1
disp('Third Newton failed!')
info = 1;
return
end
W=fasol(1);
nk=fasol(2);
KOYDBAR= (nk^(1/epsk)*KPOYDBAR^((epsk-1)/epsk)+(1-nk)^(1/epsk)*KGOYDBAR^((epsk-1)/epsk))^(epsk/(epsk-1));
MC=(1/(1-alpha))^(1-alpha)*(1/alpha)^alpha*((1+TAUWF)*W)^(1-alpha)*RENTK^alpha*(KPOYDBAR/(nk*KOYDBAR))^(alpha/epsk);
YD = (A/Z*KOYDBAR^alpha*LD^(1-alpha)/(1+phiOyd))^(1/(1-alpha));
KG = KGOYDBAR*YD;
KP = KPOYDBAR*YD;
K = KOYDBAR*YD;
phi= phiOyd*YD;
I = IOYDBAR*YD;
IM = IMOYDBAR*YD;
CM = CMOYDBAR*YD;
M = IM+CM;
T = TOYDBAR*YD;
GC = GCOYDBAR*YD;
GI = GIOYDBAR*YD;
OTHGOV = OTHGOVOYDBAR*YD;
TNR = (1-iota)/iota*T/(1-omega)/(1+(1-iota)/iota*omega/(1-omega));
N=(Q*KP)/qkOn;
we=weOn*N;
WSTAR = ((1-thetaw*Z^(EPSW-1))/(1-thetaw)*W^(1-EPSW))^(1/(1-EPSW));
fun = @(fa) [ ...
fa(2)-fa(1)^(-epsc)/(1-CM/fa(2)*(PMOP/fa(1))^(epsc))*(YD-ni*PIOP^epsi*I-VX*(PWOPEX/PXOPEX)*M-GI-GC-((mu*G*RK*Q*KP/(Z*PI))+bigtheta*(1-GAMMAN)*((Q*KP)/qkOn-weOn*(Q*KP)/qkOn)/GAMMAN)),...
fa(1)-((1-CM/fa(2)*(PMOP/fa(1))^(epsc))+(1-(1-CM/fa(2)*(PMOP/fa(1))^(epsc)))*PMOP^(1-epsc))^(1/(1-epsc))
];
[fasol, fval, exitflag] = fsolve(fun,[1,1], options);
if exitflag<1
disp('Fourth Newton failed!')
info = 1;
return
end
PCOP=fasol(1);
C=fasol(2);
nc = (1-CM/C*(PMOP/PCOP)^(epsc));
CNR = ((1-TAUN-TAUWH)*W*LD+TNR)/((1+TAUC)*PCOP);
CR = (omega*CNR-C)/(omega-1);
CINDEX= (ng^(1/epsg)*CR^((epsg-1)/epsg)+(1-ng)^(1/epsg)*GC^((epsg-1)/epsg))^(epsg/(epsg-1));
LAMBDA = (ng*CINDEX/CR)^(1/epsg)*(Z-h*beta)/(Z-h)/CINDEX/((1+TAUC)*PCOP);
F1=((EPSW-1)*(1-TAUN-TAUWH)*WSTAR^(1-EPSW)*LAMBDA*W^EPSW*LD)/(1-beta*thetaw*Z^(EPSW-1));
psi=F1*(1-beta*thetaw*Z^(EPSW*(1+vartheta)))/((WSTAR/W)^(EPSW*(-1-vartheta))*EPSW*LD^(1+vartheta));
F2=EPSW*psi*(WSTAR/W)^(EPSW*(-1-vartheta))*LD^(1+vartheta)/(1-beta*thetaw*Z^(EPSW*(1+vartheta)));
TR = (T-omega*TNR)/(1-omega);
VW=(1-thetaw)*(WSTAR/W)^(-EPSW)/(1-thetaw*Z^EPSW);
N=(Q*KP)/qkOn;
we=weOn*N;
YX=M*PWOPEX/PXOPEX;
CD=nc*PCOP^epsc*C;
ID=ni*PIOP^epsi*I;
CM=CD*(1-nc)/nc*(PMOP)^(-epsc);
IM=ID*(1-ni)/ni*(PMOP)^(-epsi);
Y=VP*YD;
L=VW*LD;
X=YX*VX;
YM=CM+IM;
YW=(PXOPEX/PWOPEX)^epsw*YX;
TAULS = -((B-(GCOYDBAR+GIOYDBAR+OTHGOVOYDBAR+R*B/(PI*Z)-(RENTK-Q*delta)*tauk*KP/(YD*Z*MU)-(TAUN+TAUWH+TAUWF)*W*LD/YD-TAUC*PCOP*C/YD+TOYDBAR))*YD);
%F1=((EPSW-1)/EPSW*(1-TAUN-TAUWH)*WSTAR^(1-EPSW)*LAMBDA*W^EPSW*LD)/(1-beta*thetaw*Z^(EPSW-1));
%F2=psi*(WSTAR/W)^(EPSW*(-1-vartheta))*LD^(1+vartheta)/(1-beta*thetaw*Z^(EPSW*(1+vartheta)));
G1=(EPS-1)*LAMBDA*YD/(1-beta*thetap*PI);
G2=EPS*LAMBDA*MC*YD/(1-beta*thetap*PI);
GM1=LAMBDA*PWOPEX/PMOP*YM/(1-beta*thetam);
GM2=LAMBDA*PIMSTAR*YM/(1-beta*thetam);
GX1=LAMBDA/PXOPEX*YX/(1-beta*thetax);
GX2=LAMBDA*PIXSTAR*YX/(1-beta*thetax);
%SS ratio
massesalariale=LD*W/YD;
cOyd=C/YD;
% Fin Pub
REVGDP = tauk*(U*RENTK-PIOP*(GAMMAU+delta))*KP/(YD*Z*MU)+(TAUN+TAUWH+TAUWF)*W*LD/YD+TAUC*PCOP*C/YD+TAULS/YD;
TOTGOVGDP = GC/YD+GI/YD+T/YD+OTHGOV/YD+(R-1)*B*YD/(PI*YD*Z);
GOVGDP = GC/YD+GI/YD+T/YD+OTHGOV/YD;
BALGDP = REVGDP - TOTGOVGDP;
PRIMBALGDP = REVGDP - GOVGDP;
% Observables
CONSUMPTION_OBS = 1;
GDP_OBS = 1;
HOURS_OBS = 1;
INFLATION_OBS = 1;
INVESTMENT_OBS = 1;
PINVEST_OBS = 1;
RE_OBS = 1;
WAGE_OBS = 1;
GOV=GC+GI+T+OTHGOV;
GC_OBS = 1;
GI_OBS = 1;
T_OBS = 1;
OTHGOV_OBS = 1;
B_OBS = B-BBAR;
CREDIT_OBS = 1;
CREDITSPREAD_OBS= 1;
NETWORTH_OBS = 1;
YWORLD_OBS = 1;
POIL_OBS = 1;
TAUC_OBS=TAUC;
TAUN_OBS=TAUN;
TAUWH_OBS=TAUWH;
TAUWF_OBS=TAUWF;
This diff is collapsed.
parameters
EPSBAR
EPSWBAR
EPSMBAR
EPSXBAR
PIBAR
alpha