Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • giovanma/dynare
  • giorgiomas/dynare
  • Vermandel/dynare
  • Dynare/dynare
  • normann/dynare
  • MichelJuillard/dynare
  • wmutschl/dynare
  • FerhatMihoubi/dynare
  • sebastien/dynare
  • lnsongxf/dynare
  • rattoma/dynare
  • CIMERS/dynare
  • FredericKarame/dynare
  • SumuduK/dynare
  • MinjeJeon/dynare
  • camilomrch/dynare
  • DoraK/dynare
  • avtishin/dynare
  • selma/dynare
  • claudio_olguin/dynare
  • jeffjiang07/dynare
  • EthanSystem/dynare
  • stepan-a/dynare
  • wjgatt/dynare
  • JohannesPfeifer/dynare
  • gboehl/dynare
  • ebenetce/dynare
  • chskcau/dynare-doc-fixes
28 results
Select Git revision
Loading items
Show changes
Showing
with 1360 additions and 251 deletions
/*
* This file shows how to use "system prior"-type prior restrictions as in
* Michal Andrle/Miroslav Plašil (2018): "Econometrics with system priors",
* Economics Letters, 172, pp. 134-137 during estimation based on
* the baseline New Keynesian model of Jordi Galí (2015): Monetary Policy, Inflation,
* and the Business Cycle, Princeton University Press, Second Edition, Chapter 3
*
* THIS MOD-FILE REQUIRES DYNARE 4.5 OR HIGHER
*
* Notes:
* - The estimation will automatically take the Gali_2015_prior_restrictions.m into
* account, which has the required name and format
* - Estimation is based on simulated data
* - The file also shows how to use a prior/posterior-function
*
* This implementation was written by Johannes Pfeifer. In case you spot mistakes,
* email me at jpfeifer@gmx.de
*
* Please note that the following copyright notice only applies to this Dynare
*/
/*
* Copyright © 2021-2023 Dynare Team
*
* This file is part of Dynare.
*
* Dynare is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dynare is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
var pi ${\pi}$ (long_name='inflation')
y_gap ${\tilde y}$ (long_name='output gap')
y_nat ${y^{nat}}$ (long_name='natural output') //(in contrast to the textbook defined in deviation from steady state)
y ${y}$ (long_name='output')
yhat ${\hat y}$ (long_name='output deviation from steady state')
r_nat ${r^{nat}}$ (long_name='natural interest rate')
i ${i}$ (long_name='nominal interrst rate')
n ${n}$ (long_name='hours worked')
nu ${\nu}$ (long_name='AR(1) monetary policy shock process')
a ${a}$ (long_name='AR(1) technology shock process')
z ${z}$ (long_name='AR(1) preference shock process')
p ${p}$ (long_name='price level')
w ${w}$ (long_name='nominal wage')
c ${c}$ (long_name='consumption')
;
varexo eps_a ${\varepsilon_a}$ (long_name='technology shock')
eps_nu ${\varepsilon_\nu}$ (long_name='monetary policy shock')
eps_z ${\varepsilon_z}$ (long_name='preference shock innovation')
;
parameters alppha ${\alpha}$ (long_name='capital share')
betta ${\beta}$ (long_name='discount factor')
rho_a ${\rho_a}$ (long_name='autocorrelation technology shock')
rho_nu ${\rho_{\nu}}$ (long_name='autocorrelation monetary policy shock')
rho_z ${\rho_{z}}$ (long_name='autocorrelation monetary demand shock')
siggma ${\sigma}$ (long_name='inverse EIS')
varphi ${\varphi}$ (long_name='inverse Frisch elasticity')
phi_pi ${\phi_{\pi}}$ (long_name='inflation feedback Taylor Rule')
phi_y ${\phi_{y}}$ (long_name='output feedback Taylor Rule')
eta ${\eta}$ (long_name='semi-elasticity of money demand')
epsilon ${\epsilon}$ (long_name='demand elasticity')
theta ${\theta}$ (long_name='Calvo parameter')
;
%----------------------------------------------------------------
% Parametrization, p. 67 and p. 113-115
%----------------------------------------------------------------
siggma = 1;
varphi = 5;
phi_pi = 1.5;
phi_y = 0.125;
theta = 3/4;
rho_nu =0.5;
rho_z = 0.5;
rho_a = 0.9;
betta = 0.99;
eta = 3.77; %footnote 11, p. 115
alppha = 1/4;
epsilon = 9;
%----------------------------------------------------------------
% First Order Conditions
%----------------------------------------------------------------
model(linear);
//Composite parameters
#Omega=(1-alppha)/(1-alppha+alppha*epsilon); %defined on page 60
#psi_n_ya=(1+varphi)/(siggma*(1-alppha)+varphi+alppha); %defined on page 62
#lambda=(1-theta)*(1-betta*theta)/theta*Omega; %defined on page 61
#kappa=lambda*(siggma+(varphi+alppha)/(1-alppha)); %defined on page 63
[name='New Keynesian Phillips Curve eq. (22)']
pi=betta*pi(+1)+kappa*y_gap;
[name='Dynamic IS Curve eq. (23)']
y_gap=-1/siggma*(i-pi(+1)-r_nat)+y_gap(+1);
[name='Interest Rate Rule eq. (26)']
i=phi_pi*pi+phi_y*yhat+nu;
[name='Definition natural rate of interest eq. (24)']
r_nat=-siggma*psi_n_ya*(1-rho_a)*a+(1-rho_z)*z;
[name='Definition natural output, eq. (20)']
y_nat=psi_n_ya*a;
[name='Definition output gap']
y_gap=y-y_nat;
[name='Monetary policy shock']
nu=rho_nu*nu(-1)+eps_nu;
[name='TFP shock']
a=rho_a*a(-1)+eps_a;
[name='Production function (eq. 14)']
y=a+(1-alppha)*n;
[name='Preference shock, p. 54']
z=rho_z*z(-1) - eps_z;
[name='Output deviation from steady state']
yhat=y-steady_state(y);
[name='Definition price level']
pi=p-p(-1);
[name='resource constraint, eq. (12)']
y=c;
[name='FOC labor, eq. (2)']
w-p=siggma*c+varphi*n;
end;
shocks;
var eps_nu = 0.0025^2; //1 standard deviation shock of 25 basis points, i.e. 1 percentage point annualized
end;
% simulate data
stoch_simul(periods=100,drop=0,irf=0) yhat;
% save data
datatomfile('sim_data',{'yhat'});
estimated_params;
theta,0.75,beta_pdf,0.5,0.1;
betta, beta_pdf, 0.993, 0.002;
alppha, beta_pdf, 0.25, 0.02;
end;
varobs yhat;
% Run prior function to get prior slope of the PC based on independent priors
hh_fig=figure('Name','Slope of the Phillips Curve');
prior_function(function='Gali_2015_PC_slope');
PC_slope_vec=cell2mat(oo_.prior_function_results(:,1));
optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian');
[density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian');
figure(hh_fig)
subplot(3,1,1)
plot(density(:,1),density(:,2));
title('Prior')
% Run estimation with 1 observation to show effect of _prior_restriction .m
% on independent prior
estimation(datafile='sim_data',mode_compute=5,mh_replic=2001,mh_nblocks=1,diffuse_filter,nobs=1,mh_jscale=0.8);
posterior_function(function='Gali_2015_PC_slope');
PC_slope_vec=cell2mat(oo_.posterior_function_results(:,1));
optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian');
[density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian');
figure(hh_fig)
subplot(3,1,2)
plot(density(:,1),density(:,2));
title('Updated Prior')
% Run estimation with full observations
estimation(datafile='sim_data',mode_compute=5,mh_replic=2001,mh_nblocks=1,diffuse_filter,nobs=100,mh_jscale=0.8);
posterior_function(function='Gali_2015_PC_slope');
PC_slope_vec=cell2mat(oo_.posterior_function_results(:,1));
optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian');
[density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian');
figure(hh_fig)
subplot(3,1,3)
plot(density(:,1),density(:,2));
title('Posterior')
function output_cell =PC_slope(xparam1,M_,options_,oo_,estim_params_,bayestopt_,dataset_,dataset_info)
% output_cell =PC_slope(xparam1,M_,options_,oo_,estim_params_,bayestopt_,dataset_,dataset_info);
% This is an example file computing statistics on the prior/posterior draws. The
% function allows read-only access to all Dynare structures. However, those
% structures are local to this function. Changing them will not affect
% other Dynare functions and you cannot use them to pass results to other
% Dynare functions.
% The function takes one and only one output argument: an 1 by n cell.
% Using functions like cell2mat, the contents of the cell can be easily
% transformed back to matrices. See the fs2000_posterior_function.mod for
% an example
% INPUTS
% xparam1 Current parameter draw
% M_ [structure] Matlab's structure describing the Model (initialized by dynare, see @ref{M_}).
% options_ [structure] Matlab's structure describing the options (initialized by dynare, see @ref{options_}).
% oo_ [structure] Matlab's structure gathering the results (initialized by dynare, see @ref{oo_}).
% estim_params_[structure] Matlab's structure describing the estimated_parameters (initialized by dynare, see @ref{estim_params_}).
% bayestopt_ [structure] Matlab's structure describing the parameter options (initialized by dynare, see @ref{bayestopt_}).
% dataset_ [structure] Matlab's structure storing the dataset
% dataset_info [structure] Matlab's structure storing the information about the dataset
% Output
% output_cell [1 by n cell] 1 by n Matlab cell allowing to store any
% desired computation or result (strings, matrices, structures, etc.)
% Copyright © 2021 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%% store the slope based on the parameter draw
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
paramname = deblank(M_.param_names{ii,:});
eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
Omega=(1-alppha)/(1-alppha+alppha*epsilon);
lambda=(1-theta)*(1-betta*theta)/theta*Omega; %defined on page 61
output_cell{1,1}=lambda*(siggma+(varphi+alppha)/(1-alppha)); %defined on page 63
end
\ No newline at end of file
function log_prior_val=Gali_2015_prior_restrictions(M_, dr, endo_steady_state, exo_steady_state, exo_det_steady_state, options_, dataset_, dataset_info);
% function prior_val=Gali_2015_prior_restrictions(M_, dr, endo_steady_state, exo_steady_state, exo_det_steady_state, options_, dataset_, dataset_info);
% Example of a _prior_restrictions-file automatically called during
% estimation
% It imposes a prior of the slope of the New Keynesian Phillips Curve of
% 0.03. As the slope is a composite of other parameters with independent
% priors, a separate function is required to do this.
% Copyright © 2021-2023 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
% read out parameters to access them with their name
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
paramname = M_.param_names{ii};
eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
Omega=(1-alppha)/(1-alppha+alppha*epsilon);
lambda=(1-theta)*(1-betta*theta)/theta*Omega; %defined on page 61
kappa=lambda*(siggma+(varphi+alppha)/(1-alppha)); %defined on page 63
prior_mean=0.03;
prior_std=0.02;
log_prior_val=log(normpdf(kappa,prior_mean,prior_std));
\ No newline at end of file
/*
* This file implements the Baseline New Keynesian DSGE model described in
* much detail in Jesús Fernández-Villaverde and Juan F. Rubio-Ramírez (2006): "A Baseline DSGE
* Model", available at http://economics.sas.upenn.edu/~jesusfv/benchmark_DSGE.pdf
* much detail in Jesús Fernández-Villaverde and Juan F. Rubio-Ramírez (2006): “A Baseline DSGE
* Model”, available at http://economics.sas.upenn.edu/~jesusfv/benchmark_DSGE.pdf
*
* The parametrization is based on the estimated version of this model in
* Jesús Fernández-Villaverde (2010): "The econometrics of DSGE models",
 
* SERIEs, Vol. 1, pp. 3-49, DOI 10.1007/s13209-009-0014-7
*
* This implementation was written by Benjamin Born and Johannes Pfeifer. In
......@@ -17,23 +17,26 @@
* and ii) solve a nonlinear equation using a numerical solver to find the steady
* state of labor. It provides an example on how the steady state file can be used
* to circumvent some of the limitation of Dynare mod-file by accessing an external
* file that allows calling general Matlab routines. These capacities will mostly be
* file that allows calling general MATLAB routines. These capacities will mostly be
* interesting for power users. If one just wants to provide analytical steady state
* values and update parameters, the steady_state_model-block allows an easy and convenient
* alternative. It even allows calling numerical solvers like fsolve. For an example, see
* example3.mod
*
* The model is written in the beginning of period stock notation. To make the model
* conform with Dynare's end of period stock notation, we use the
* conform with Dynare’s end of period stock notation, we use the
* predetermined_variables-command.
*
* The model has been implemented in detrended form, i.e. the \mu_{i,t} are actually
* the the growth rates of the original \mu_{i,t}^{orig} in the paper, i.e.
* log(\mu_{i,t})=log(\mu_{i,t}^{orig}/\mu_{i,t-1}^{orig})
*
* Please note that the following copyright notice only applies to this Dynare
* implementation of the model.
*/
/*
* Copyright (C) 2013-2016 Dynare Team
* Copyright © 2013-2023 Dynare Team
*
* This file is part of Dynare.
*
......@@ -48,75 +51,81 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
var d //preference shock
c //consumption
mu_z //trend growth rate of the economy (from neutral and investment specific technology)
mu_I //growth rate of investment-specific technology growth
mu_A //growth rate of neutral technology
lambda //Lagrange multiplier
R //Nominal Interest rate
PI //Inflation
r //rental rate of capital
x //investment
u //capacity utilization
q //Tobin's marginal q
f //variable for recursive formulation of wage setting
ld //aggregate labor demand
w //real wage
wstar //optimal real wage
PIstarw //optimal wage inflation
PIstar //optimal price inflation
g1 //variable 1 for recursive formulation of price setting
g2 //variable 2 for recursive formulation of price setting
yd //aggregate output
mc //marginal costs
k //capital
vp //price dispersion term
vw //wage dispersion term
l //aggregate labor bundle
phi //labor disutility shock
F; //firm profits
varexo epsd epsphi epsmu_I epsA epsm;
var d (long_name='preference shock')
c (long_name='consumption')
mu_z (long_name='trend growth rate of the economy (from neutral and investment specific technology)')
mu_I (long_name='growth rate of investment-specific technology growth')
mu_A (long_name='growth rate of neutral technology')
lambda (long_name='Lagrange multiplier')
R (long_name='Nominal Interest rate')
PI (long_name='Inflation')
r (long_name='rental rate of capital')
x (long_name='investment')
u (long_name='capacity utilization')
q (long_name='Tobin marginal q')
f (long_name='variable for recursive formulation of wage setting')
ld (long_name='aggregate labor demand')
w (long_name='real wage')
wstar (long_name='optimal real wage')
PIstarw (long_name='optimal wage inflation')
PIstar (long_name='optimal price inflation')
g1 (long_name='variable 1 for recursive formulation of price setting')
g2 (long_name='variable 2 for recursive formulation of price setting')
yd (long_name='aggregate output')
mc (long_name='marginal costs')
k (long_name='capital')
vp (long_name='price dispersion term')
vw (long_name='wage dispersion term')
l (long_name='aggregate labor bundle')
phi (long_name='labor disutility shock')
F (long_name='firm profits')
;
predetermined_variables k;
varexo epsd (long_name='Innovation preference shock')
epsphi (long_name='Innovation labor disutility shock')
epsmu_I (long_name='Innovation investment-specific technology')
epsA (long_name='Innovation neutral technology')
epsm (long_name='Innovation monetary policy shock')
;
parameters h //consumption habits
betta //discount factor
gammma1 //capital utilization, linear term
gammma2 //capital utilization, quadratic term
delta //depreciation rate
kappa //capital adjustment costs parameter
eta //elasticity of substitution between labor varieties
epsilon //elasticity of substitution between goods varieties
varpsi //labor disutility parameter
gammma //inverse Frisch elasticity
chiw //wage indexation parameter
chi //price indexation
thetap //Calvo parameter prices
thetaw //Calvo parameter wages
alppha //capital share
Rbar //steady state interest rate
PIbar //steady state inflation
gammmaR //interest smoothing coefficient Taylor rule
gammmaPI //feedback coefficient to inflation monetary policy rule
gammmay //feedback coefficient to output growth deviation in monetary policy rule
Phi //firms fixed costs
rhod //autocorrelation preference shock
rhophi //autocorrelation labor disutility shock
Lambdamu //steady state growth rate of investmentment-specific technology
LambdaA //steady state neutral technology growth
Lambdax //steady state growth rate of investment
LambdaYd //steady state growth rate of output
sigma_d //standard deviation preference shock
sigma_phi //standard deviation labor disutility shock
sigma_mu //standard deviation investment-specific technology
sigma_A //standard deviation neutral technology
sigma_m; //standard deviation preference shock
predetermined_variables k;
parameters h (long_name='consumption habits')
betta (long_name='discount factor')
gammma1 (long_name='capital utilization, linear term')
gammma2 (long_name='capital utilization, quadratic term')
delta (long_name='depreciation rate')
kappa (long_name='capital adjustment costs parameter')
eta (long_name='elasticity of substitution between labor varieties')
epsilon (long_name='elasticity of substitution between goods varieties')
varpsi (long_name='labor disutility parameter')
gammma (long_name='inverse Frisch elasticity')
chiw (long_name='wage indexation parameter')
chi (long_name='price indexation')
thetap (long_name='Calvo parameter prices')
thetaw (long_name='Calvo parameter wages')
alppha (long_name='capital share')
Rbar (long_name='steady state interest rate')
PIbar (long_name='steady state inflation')
gammmaR (long_name='interest smoothing coefficient Taylor rule')
gammmaPI (long_name='feedback coefficient to inflation monetary policy rule')
gammmay (long_name='feedback coefficient to output growth deviation in monetary policy rule')
Phi (long_name='firms fixed costs')
rhod (long_name='autocorrelation preference shock')
rhophi (long_name='autocorrelation labor disutility shock')
Lambdamu (long_name='steady state growth rate of investmentment-specific technology')
LambdaA (long_name='steady state neutral technology growth')
Lambdax (long_name='steady state growth rate of investment')
LambdaYd (long_name='steady state growth rate of output')
sigma_d (long_name='standard deviation preference shock')
sigma_phi (long_name='standard deviation labor disutility shock')
sigma_mu (long_name='standard deviation investment-specific technology')
sigma_A (long_name='standard deviation neutral technology')
sigma_m (long_name='standard deviation monetary policy shock')
;
//Note that the parameter naming in FV(2010) differs from FV(2006)
//Fixed parameters, taken from FV(2010), Table 2, p. 37
......@@ -146,12 +155,12 @@ gammmaPI =1.29;
PIbar = 1.01;
rhod = 0.12;
rhophi = 0.93;
sigma_A = -3.97;
sigma_d = -1.51;
sigma_A = exp(-3.97);
sigma_d = exp(-1.51);
sigma_phi =-2.36;
sigma_mu =-5.43;
sigma_m =-5.85;
sigma_phi =exp(-2.36);
sigma_mu =exp(-5.43);
sigma_m =exp(-5.85);
Lambdamu=3.4e-3;
LambdaA = 2.8e-3;
......@@ -164,7 +173,7 @@ algorithm, while the parameters initialized here are only set once for the initi
values of the parameters they depend on:
gammma1=mu_z*mu_I/betta-(1-delta);
R=1+(PIbar*mu_z/betta-1);
Rbar=1+(PIbar*mu_z/betta-1);
Lambdax=exp(LambdaYd);
LambdaYd= (LambdaA+alppha*Lambdamu)/(1-alppha);
*/
......@@ -177,70 +186,77 @@ FV(2006), p. 20, section 3.2.
*/
model;
//1. FOC consumption
[name='FOC consumption']
d*(c-h*c(-1)*mu_z^(-1))^(-1)-h*betta*d(+1)*(c(+1)*mu_z(+1)-h*c)^(-1)=lambda;
//2. Euler equation
[name='Euler equation']
lambda=betta*lambda(+1)*mu_z(+1)^(-1)/PI(+1)*R;
//3. FOC capital utilization
[name='FOC capital utilization']
r=gammma1+gammma2*(u-1);
//4. FOC capital
[name='FOC capital']
q=betta*lambda(+1)/lambda*mu_z(+1)^(-1)*mu_I(+1)^(-1)*((1-delta)*q(+1)+r(+1)*u(+1)-(gammma1*(u(+1)-1)+gammma2/2*(u(+1)-1)^2));
//5. FOC investment
[name='FOC investment']
1=q*(1-(kappa/2*(x/x(-1)*mu_z-Lambdax)^2)-(kappa*(x/x(-1)*mu_z-Lambdax)*x/x(-1)*mu_z))
+betta*q(+1)*lambda(+1)/lambda*mu_z(+1)^(-1)*kappa*(x(+1)/x*mu_z(+1)-Lambdax)*(x(+1)/x*mu_z(+1))^2;
//6-7. Wage setting
[name='Wage setting 1']
f=(eta-1)/eta*wstar^(1-eta)*lambda*w^eta*ld+betta*thetaw*(PI^chiw/PI(+1))^(1-eta)*(wstar(+1)/wstar*mu_z(+1))^(eta-1)*f(+1);
[name='Wage setting 2']
f=varpsi*d*phi*PIstarw^(-eta*(1+gammma))*ld^(1+gammma)+betta*thetaw*(PI^chiw/PI(+1))^(-eta*(1+gammma))*(wstar(+1)/wstar*mu_z(+1))^(eta*(1+gammma))*f(+1);
//8-10. firm's price setting
[name='Firm price setting 1']
g1=lambda*mc*yd+betta*thetap*(PI^chi/PI(+1))^(-epsilon)*g1(+1);
[name='Firm price setting 2']
g2=lambda*PIstar*yd+betta*thetap*(PI^chi/PI(+1))^(1-epsilon)*PIstar/PIstar(+1)*g2(+1);
[name='Firm price setting 3']
epsilon*g1=(epsilon-1)*g2;
//11-12. optimal inputs
[name='Optimal capital labor ratio']
u*k/ld=alppha/(1-alppha)*w/r*mu_z*mu_I;
[name='Marginal costs']
mc=(1/(1-alppha))^(1-alppha)*(1/alppha)^alppha*w^(1-alppha)*r^alppha;
//13. law of motion wages
[name='law of motion wages']
1=thetaw*(PI(-1)^chiw/PI)^(1-eta)*(w(-1)/w*mu_z^(-1))^(1-eta)+(1-thetaw)*PIstarw^(1-eta);
//14. law of motion prices
[name='law of motion prices']
1=thetap*(PI(-1)^chi/PI)^(1-epsilon)+(1-thetap)*PIstar^(1-epsilon);
//15. Taylor Rule
R/Rbar=(R(-1)/Rbar)^gammmaR*((PI/PIbar)^gammmaPI*((yd/yd(-1)*mu_z)/exp(LambdaYd))^gammmay)^(1-gammmaR)*exp(epsm);
[name='Taylor Rule']
R/Rbar=(R(-1)/Rbar)^gammmaR*((PI/PIbar)^gammmaPI*((yd/yd(-1)*mu_z)/exp(LambdaYd))^gammmay)^(1-gammmaR)*exp(sigma_m*epsm);
//16-17. Market clearing
[name='Resource constraint']
yd=c+x+mu_z^(-1)*mu_I^(-1)*(gammma1*(u-1)+gammma2/2*(u-1)^2)*k;
[name='Aggregate production']
yd=(mu_A*mu_z^(-1)*(u*k)^alppha*ld^(1-alppha)-Phi)/vp;
//18-20. Price and wage dispersion terms
[name='Aggregate labor market']
l=vw*ld;
[name='LOM Price dispersion term']
vp=thetap*(PI(-1)^chi/PI)^(-epsilon)*vp(-1)+(1-thetap)*PIstar^(-epsilon);
[name='LOM Wage dispersion term']
vw=thetaw*(w(-1)/w*mu_z^(-1)*PI(-1)^chiw/PI)^(-eta)*vw(-1)+(1-thetaw)*(PIstarw)^(-eta);
//21. Law of motion for capital
[name='Law of motion for capital']
k(+1)*mu_z*mu_I-(1-delta)*k-mu_z*mu_I*(1-kappa/2*(x/x(-1)*mu_z-Lambdax)^2)*x=0;
//22. Profits
[name='Profits']
F=yd-1/(1-alppha)*w*ld;
//23. definition optimal wage inflation
[name='definition optimal wage inflation']
PIstarw=wstar/w;
//exogenous processes
//24. Preference Shock
log(d)=rhod*log(d(-1))+epsd;
//25. Labor disutility Shock
log(phi)=rhophi*log(phi(-1))+epsphi;
//26. Investment specific technology
log(mu_I)=Lambdamu+epsmu_I;
//27. Neutral technology
log(mu_A)=LambdaA+epsA;
//28. Defininition composite technology
[name='Preference Shock']
log(d)=rhod*log(d(-1))+sigma_d*epsd;
[name='Labor disutility Shock']
log(phi)=rhophi*log(phi(-1))+sigma_phi*epsphi;
[name='Investment specific technology']
log(mu_I)=Lambdamu+sigma_mu*epsmu_I;
[name='Neutral technology']
log(mu_A)=LambdaA+sigma_A*epsA;
[name='Defininition composite technology']
mu_z=mu_A^(1/(1-alppha))*mu_I^(alppha/(1-alppha));
end;
shocks;
var epsd; stderr exp(sigma_d);
var epsphi; stderr exp(sigma_phi);
var epsmu_I; stderr exp(sigma_mu);
var epsA; stderr exp(sigma_A);
var epsm; stderr exp(sigma_m);
var epsd; stderr 1;
var epsphi; stderr 1;
var epsmu_I; stderr 1;
var epsA; stderr 1;
var epsm; stderr 1;
end;
steady;
......
function [ys,check] = NK_baseline_steadystate(ys,exo)
% function [ys,check] = NK_baseline_steadystate(ys,exo)
function [ys,params,check] = NK_baseline_steadystate(ys,exo,M_,options_)
% function [ys,params,check] = NK_baseline_steadystate(ys,exo,M_,options_)
% computes the steady state for the NK_baseline.mod and uses a numerical
% solver to do so
% Inputs:
% - ys [vector] vector of initial values for the steady state of
% the endogenous variables
% - exo [vector] vector of values for the exogenous variables
% - M_ [structure] Dynare model structure
% - options [structure] Dynare options structure
%
% Output:
% - ys [vector] vector of steady state values fpr the the endogenous variables
% - ys [vector] vector of steady state values for the the endogenous variables
% - params [vector] vector of parameter values
% - check [scalar] set to 0 if steady state computation worked and to
% 1 of not (allows to impos restriction on parameters)
% 1 of not (allows to impose restrictions on parameters)
global M_
% Copyright © 2013-2024 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
% make parameter explicitly known to Matlab to avoid naming conflicts; actual value is read out
% in next eval-loop
delta=0;
% read out parameters to access them with their name
NumberOfParameters = M_.param_nbr;
......@@ -28,14 +50,12 @@ check = 0;
options=optimset(); % set options for numerical solver
% the steady state computation follows FV (2006), section 4.1
% the steady state computation follows FVRR (2006), section 4.1
PI=PIbar;
u=1;
q=1;
d=1;
phi=1;
m=0;
zeta=1;
LambdaYd= (LambdaA+alppha*Lambdamu)/(1-alppha);
mu_z=exp(LambdaYd);
mu_I=exp(Lambdamu);
......@@ -47,6 +67,7 @@ Lambdax=mu_z;
%set the parameter gammma1
gammma1=mu_z*mu_I/betta-(1-delta);
if gammma1<0 % parameter violates restriction; Preventing this cannot be implemented via prior restriction as it is a composite of different parameters and the valid prior region has unknown form
params=M_.params;
check=1; %set failure indicator
return; %return without updating steady states
end
......@@ -68,13 +89,20 @@ vp=(1-thetap)/(1-thetap*PI^((1-chi)*epsilon))*PIstar^(-epsilon);
vw=(1-thetaw)/(1-thetaw*PI^((1-chiw)*eta)*mu_z^eta)*PIstarw^(-eta);
tempvaromega=alppha/(1-alppha)*w/r*mu_z*mu_I;
try
%proper error handling for cases for infeasible initial value, which would result in error instead of valid exitflag
[ld,fval,exitflag]=fzero(@(ld)(1-betta*thetaw*mu_z^(eta-1)*PI^(-(1-chiw)*(1-eta)))/(1-betta*thetaw*mu_z^(eta*(1+gammma))*PI^(eta*(1-chiw)*(1+gammma)))...
-(eta-1)/eta*wstar/(varpsi*PIstarw^(-eta*gammma)*ld^gammma)*((1-h*mu_z^(-1))^(-1)-betta*h*(mu_z-h)^(-1))*...
((mu_A*mu_z^(-1)*vp^(-1)*tempvaromega^alppha-tempvaromega*(1-(1-delta)*(mu_z*mu_I)^(-1)))*ld-vp^(-1)*Phi)^(-1),0.25,options);
catch
exitflag = 0;
end
if exitflag <1
%indicate the SS computation was not sucessful; this would also be detected by Dynare
%setting the indicator here shows how to use this functionality to
%filter out parameter draws
params=M_.params;
check=1; %set failure indicator
return; %return without updating steady states
end
......@@ -95,8 +123,9 @@ g2=epsilon/(epsilon-1)*g1;
%% end own model equations
params=NaN(NumberOfParameters,1);
for iter = 1:length(M_.params) %update parameters set in the file
eval([ 'M_.params(' num2str(iter) ') = ' M_.param_names{iter} ';' ])
eval([ 'params(' num2str(iter) ') = ' M_.param_names{iter} ';' ])
end
NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
......
/*
* This file shows how to solve an RBC model with two occasionally binding constraints:
* 1. The INEG constraint implements quadratic capital adjustment costs if investment
* falls below its steady state. If investment is above steady state, there are no
* adjustment costs
* 2. The IRR constraint implements irreversible investment. Investment cannot be lower
* than a factor phi of its steady state.
*
* Notes:
* - This mod-file is based on an example originally provided by Luca Guerrieri
* and Matteo Iacoviello provided at https://www.matteoiacoviello.com/research_files/occbin_20140630.zip
* - The INEG constraint should theoretically be log_Invest-log(steady_state(Invest))<0, but this will lead
* to numerical issues. Instead we allow for a small negative value of <-0.000001
*
* Please note that the following copyright notice only applies to this Dynare
* implementation of the model.
*/
/*
* Copyright © 2021 Dynare Team
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* It is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For A copy of the GNU General Public License,
* see <https://www.gnu.org/licenses/>.
*/
var A $A$ (long_name='TFP')
C $C$ (long_name='consumption')
Invest $I$ (long_name='investment')
K $K$ (long_name='capital')
Lambda $\lambda$ (long_name='Lagrange multiplier')
log_K ${\hat K}$ (long_name='log capital')
log_Invest ${\hat I}$ (long_name='log investment')
log_C ${\hat C}$ (long_name='log consumption')
;
varexo epsilon $\varepsilon$ (long_name='TFP shock');
parameters alpha $\alpha$ (long_name='capital share')
delta $\delta$ (long_name='depreciation')
beta $\beta$ (long_name='discount factor')
sigma $\sigma$ (long_name='risk aversion')
rho $\rho$ (long_name='autocorrelation TFP')
phi $\phi$ (long_name='irreversibility fraction of steady state investment')
psi $\psi$ (long_name='capital adjustment cost')
;
beta=0.96;
alpha=0.33;
delta=0.10;
sigma=2;
rho = 0.9;
phi = 0.975;
psi = 5;
model;
// 1.
[name='Euler', bind = 'INEG']
-C^(-sigma)*(1+2*psi*(K/K(-1)-1)/K(-1))+ beta*C(+1)^(-sigma)*((1-delta)-2*psi*(K(+1)/K-1)*
(-K(+1)/K^2)+alpha*exp(A(+1))*K^(alpha-1))= -Lambda+beta*(1-delta)*Lambda(+1);
[name='Euler', relax = 'INEG']
-C^(-sigma) + beta*C(+1)^(-sigma)*(1-delta+alpha*exp(A(+1))*K^(alpha-1))= -Lambda+beta*(1-delta)*Lambda(+1);
// 2.
[name='Budget constraint',bind = 'INEG']
C+K-(1-delta)*K(-1)+psi*(K/K(-1)-1)^2=exp(A)*K(-1)^(alpha);
[name='Budget constraint',relax = 'INEG']
C+K-(1-delta)*K(-1)=exp(A)*K(-1)^(alpha);
// 3.
[name='LOM capital']
Invest = K-(1-delta)*K(-1);
// 4.
[name='investment',bind='IRR,INEG']
(log_Invest - log(phi*steady_state(Invest))) = 0;
[name='investment',relax='IRR']
Lambda=0;
[name='investment',bind='IRR',relax='INEG']
(log_Invest - log(phi*steady_state(Invest))) = 0;
// 5.
[name='LOM TFP']
A = rho*A(-1)+epsilon;
// Definitions
[name='Definition log capital']
log_K=log(K);
[name='Definition log consumption']
log_C=log(C);
[name='Definition log investment']
log_Invest=log(Invest);
end;
occbin_constraints;
name 'IRR'; bind log_Invest-log(steady_state(Invest))<log(phi); relax Lambda<0;
name 'INEG'; bind log_Invest-log(steady_state(Invest))<-0.000001; %not exactly 0 for numerical reasons
end;
steady_state_model;
K = ((1/beta-1+delta)/alpha)^(1/(alpha-1));
C = -delta*K +K^alpha;
Invest = delta*K;
log_K = log(K);
log_C = log(C);
log_Invest = log(Invest);
Lambda = 0;
A=0;
end;
shocks;
var epsilon; stderr 0.015;
end;
steady;
shocks(surprise);
var epsilon;
periods 1:9, 10, 50, 90, 130, 131:169;
values -0.0001, -0.01,-0.02, 0.01, 0.02, 0;
end;
occbin_setup;
occbin_solver(simul_periods=200,simul_check_ahead_periods=200);
occbin_graph log_C epsilon Lambda log_K log_Invest A;
/*
* This file replicates the model studied in:
* Lawrence J. Christiano, Roberto Motto and Massimo Rostagno (2007):
* "Notes on Ramsey-Optimal Monetary Policy", Section 2
* The paper is available at http://faculty.wcas.northwestern.edu/~lchrist/d16/d1606/ramsey.pdf
*
* Notes:
* - This mod-files allows to simulate a simple New Keynesian Model with Rotemberg price
* adjustment costs under three different monetary policy arrangements:
* 1. a Taylor rule with a fixed inflation feedback coefficient alpha
* -> set the Optimal_policy switch to 0
* 2. a Taylor rule where the inflation feedback coefficient alpha is chosen
* optimally to minimize a quadratic loss function (optimal simple rule (OSR))
* -> set the Optimal_policy switch to 1 and the Ramsey switch to 0
* 3. fully optimal monetary under commitment (Ramsey)
* -> set the Optimal_policy switch to 1 and the Ramsey switch to 1
*
* - The Efficent_steady_state switch can be used to switch from an distorted steady state
* due to a monopolistic distortion to one where a labor subsidy counteracts this
* distortion. Note that the purely quadratic loss function in the OSR case does not capture
* the full welfare losses with a distorted steady state as there would be a linear term
* appearing.
*
* - This files shows how to use a conditional steady state file in the Ramsey case. It takes
* the value of the defined instrument R as given and then computes the rest of the steady
* state, including the steady state inflation rate, based on this value. The initial value
* of the instrument for steady state search must then be defined in an initval-block.
*
* - The optim_weights in the OSR case are based on a second order approximation to the welfare function
* as in Gali (2015). The relative weight between inflation and output gap volatility is essentially
* given by the slope of the New Keynesian Phillips Curve. Note that the linear terms that would be
* present in case of a distorted steady state need to be dropped for OSR.
*
* - Due to divine coincidence, the first best policy involves fully stabilizing inflation
* and thereby the output gap. As a consequence, the optimal inflation feedback coefficient
* in a Taylor rule would be infinity. The OSR command therefore estimates it to be at the
* upper bound defined via osr_params_bounds.
*
* - The mod-file also allows to conduct estimation under Ramsey policy by setting the
* Estimation_under_Ramsey switch to 1.
*
* This implementation was written by Johannes Pfeifer.
*
* If you spot mistakes, email me at jpfeifer@gmx.de
*
* Please note that the following copyright notice only applies to this Dynare
* implementation of the model.
*/
/*
* Copyright © 2019 Dynare Team
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* It is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a copy of the GNU General Public License,
* see <https://www.gnu.org/licenses/>.
*/
//**********Define which monetary policy setup to use ***********
@#ifndef Optimal_policy
@#define Optimal_policy=1
@#ifndef Ramsey
@#define Ramsey=1
@#endif
@#endif
//**********Define whether to use distorted steady state***********
@#ifndef Efficent_steady_state
@#define Efficent_steady_state=0
@#endif
@#ifndef Estimation_under_Ramsey
@#define Estimation_under_Ramsey=0
@#endif
var C $C$ (long_name='Consumption')
pi $\pi$ (long_name='Gross inflation')
h $h$ (long_name='hours worked')
Z $Z$ (long_name='TFP')
R $R$ (long_name='Net nominal interest rate')
log_C ${\ln C}$ (long_name='Log Consumption')
log_h ${\ln h}$ (long_name='Log hours worked')
pi_ann ${\pi^{ann}}$ (long_name='Annualized net inflation')
R_ann ${R^{ann}}$ (long_name='Annualized net nominal interest rate')
r_real ${r^{ann,real}}$ (long_name='Annualized net real interest rate')
y_nat ${y^{nat}}$ (long_name='Natural (flex price) output')
y_gap ${r^{gap}}$ (long_name='Output gap')
@#if Optimal_policy==0
Welfare ${W}$ (long_name='Welfare')
@#endif
;
varexo epsilon ${\varepsilon}$ (long_name='TFP shock')
;
parameters beta ${\beta}$ (long_name='discount factor')
theta ${\theta}$ (long_name='substitution elasticity')
tau ${\tau}$ (long_name='labor subsidy')
chi ${\chi}$ (long_name='labor disutility')
phi ${\phi}$ (long_name='price adjustment costs')
rho ${\rho}$ (long_name='TFP autocorrelation')
@# if !defined(Ramsey) || Ramsey==0
pi_star ${\pi^*}$ (long_name='steady state inflation')
alpha ${\alpha}$ (long_name='inflation feedback Taylor rule')
@# endif
;
beta=0.99;
theta=5;
phi=100;
rho=0.9;
@# if !defined(Ramsey) || Ramsey==0
alpha=1.5;
pi_star=1;
@# endif
@# if Efficent_steady_state
tau=1/(theta-1);
@# else
tau=0;
@# endif
chi=1;
model;
[name='Euler equation']
1/(1+R)=beta*C/(C(+1)*pi(+1));
[name='Firm FOC']
(tau-1/(theta-1))*(1-theta)+theta*(chi*h*C/(exp(Z))-1)=phi*(pi-1)*pi-beta*phi*(pi(+1)-1)*pi(+1);
[name='Resource constraint']
C*(1+phi/2*(pi-1)^2)=exp(Z)*h;
[name='TFP process']
Z=rho*Z(-1)+epsilon;
@#if !defined(Ramsey) || Ramsey==0
[name='Taylor rule']
R=pi_star/beta-1+alpha*(pi-pi_star);
@#endif
[name='Definition log consumption']
log_C=log(C);
[name='Definition log hours worked']
log_h=log(h);
[name='Definition annualized inflation rate']
pi_ann=4*log(pi);
[name='Definition annualized nominal interest rate']
R_ann=4*R;
[name='Definition annualized real interest rate']
r_real=4*log((1+R)/pi(+1));
[name='Definition natural output']
y_nat=exp(Z)*sqrt((theta-1)/theta*(1+tau)/chi);
[name='output gap']
y_gap=log_C-log(y_nat);
@#if Optimal_policy==0
[name='Definition Welfare']
Welfare=log(C)-chi/2*h^2+beta*Welfare(+1);
@#endif
end;
steady_state_model;
Z=0;
@# if !defined(Ramsey) || Ramsey==0
R=pi_star/beta-1; %only set this if not conditional steady state file for Ramsey
@# endif
pi=(R+1)*beta;
C=sqrt((1+1/theta*((1-beta)*(pi-1)*pi-(tau-1/(theta-1))*(1-theta)))/(chi*(1+phi/2*(pi-1)^2)));
h=C*(1+phi/2*(pi-1)^2);
log_C=log(C);
log_h=log(h);
pi_ann=4*log(pi);
R_ann=4*R;
r_real=4*log((1+R)/pi);
y_nat=sqrt((theta-1)/theta*(1+tau)/chi);
y_gap=log_C-log(y_nat);
@#if Optimal_policy==0
Welfare=1/(1-beta)*(log(C)-chi/2*h^2);
@#endif
end;
@# if defined(Ramsey) && Ramsey==1
//define initial value of instrument for Ramsey
initval;
R=1/beta-1;
end;
@# endif
shocks;
var epsilon = 0.01^2;
end;
@#if Optimal_policy==0
//use Taylor rule
stoch_simul(order=2) pi_ann log_h R_ann log_C Z r_real y_nat Welfare;
@#else
@# if !defined(Ramsey) || Ramsey==0
//use OSR Taylor rule
//set weights on (co-)variances for OSR
optim_weights;
pi theta/((theta-1)/phi);
y_gap 1;
end;
//define OSR parameters to be optimized
osr_params alpha;
//starting value for OSR parameter
alpha = 1.5;
//define bounds for OSR during optimization
osr_params_bounds;
alpha, 0, 100;
end;
//compute OSR and provide output
osr(opt_algo=9) pi_ann log_h R_ann log_C Z r_real;
@# else
//use Ramsey optimal policy
//define planner objective, which corresponds to utility function of agents
planner_objective log(C)-chi/2*h^2;
//set up Ramsey optimal policy problem with interest rate R as the instrument,...
// defining the discount factor in the planner objective to be the one of private agents
ramsey_model(instruments=(R),planner_discount=beta,planner_discount_latex_name=$\beta$);
//conduct stochastic simulations of the Ramsey problem
stoch_simul(order=1,irf=20,periods=500) pi_ann log_h R_ann log_C Z r_real;
evaluate_planner_objective;
@# if Estimation_under_Ramsey==1
datatomfile('ramsey_simulation',{'log_C'})
estimated_params;
rho,0.5,uniform_pdf, , ,0,1;
end;
varobs log_C;
estimation(datafile=ramsey_simulation,mode_compute=5);
@# endif
@# endif
@# endif
\ No newline at end of file
/*
* This file replicates the model studied in:
* Lawrence J. Christiano, Roberto Motto and Massimo Rostagno (2007):
* "Notes on Ramsey-Optimal Monetary Policy", Section 2
* The paper is available at http://faculty.wcas.northwestern.edu/~lchrist/d16/d1606/ramsey.pdf
*
* Notes:
* - This mod-files allows to simulate a simple New Keynesian Model with Rotemberg price
* adjustment costs under fully optimal monetary under commitment (Ramsey)
*
* - This files shows how to use a user-defined conditional steady state file in the Ramsey case. It takes
* the value of the defined instrument R as given and then computes the rest of the steady
* state, including the steady state inflation rate, based on this value. The initial value
* of the instrument for steady state search must then be defined in an initval-block.
*
* This implementation was written by Johannes Pfeifer.
*
* If you spot mistakes, email me at jpfeifer@gmx.de
*
* Please note that the following copyright notice only applies to this Dynare
* implementation of the model.
*/
/*
* Copyright © 2019-2022 Dynare Team
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* It is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a copy of the GNU General Public License,
* see <https://www.gnu.org/licenses/>.
*/
var C $C$ (long_name='Consumption')
pi $\pi$ (long_name='Gross inflation')
h $h$ (long_name='hours worked')
Z $Z$ (long_name='TFP')
R $R$ (long_name='Net nominal interest rate')
log_C ${\ln C}$ (long_name='Log Consumption')
log_h ${\ln h}$ (long_name='Log hours worked')
pi_ann ${\pi^{ann}}$ (long_name='Annualized net inflation')
R_ann ${R^{ann}}$ (long_name='Annualized net nominal interest rate')
r_real ${r^{ann,real}}$ (long_name='Annualized net real interest rate')
y_nat ${y^{nat}}$ (long_name='Natural (flex price) output')
y_gap ${r^{gap}}$ (long_name='Output gap')
;
varexo epsilon ${\varepsilon}$ (long_name='TFP shock')
;
parameters beta ${\beta}$ (long_name='discount factor')
theta ${\theta}$ (long_name='substitution elasticity')
tau ${\tau}$ (long_name='labor subsidy')
chi ${\chi}$ (long_name='labor disutility')
phi ${\phi}$ (long_name='price adjustment costs')
rho ${\rho}$ (long_name='TFP autocorrelation')
;
beta=0.99;
theta=5;
phi=100;
rho=0.9;
tau=0;
chi=1;
model;
[name='Euler equation']
1/(1+R)=beta*C/(C(+1)*pi(+1));
[name='Firm FOC']
(tau-1/(theta-1))*(1-theta)+theta*(chi*h*C/(exp(Z))-1)=phi*(pi-1)*pi-beta*phi*(pi(+1)-1)*pi(+1);
[name='Resource constraint']
C*(1+phi/2*(pi-1)^2)=exp(Z)*h;
[name='TFP process']
Z=rho*Z(-1)+epsilon;
[name='Definition log consumption']
log_C=log(C);
[name='Definition log hours worked']
log_h=log(h);
[name='Definition annualized inflation rate']
pi_ann=4*log(pi);
[name='Definition annualized nominal interest rate']
R_ann=4*R;
[name='Definition annualized real interest rate']
r_real=4*log((1+R)/pi(+1));
[name='Definition natural output']
y_nat=exp(Z)*sqrt((theta-1)/theta*(1+tau)/chi);
[name='output gap']
y_gap=log_C-log(y_nat);
end;
initval;
R=1/beta-1;
end;
shocks;
var epsilon = 0.01^2;
end;
//use Ramsey optimal policy
//define planner objective, which corresponds to utility function of agents
planner_objective log(C)-chi/2*h^2;
//set up Ramsey optimal policy problem with interest rate R as the instrument,...
// defining the discount factor in the planner objective to be the one of private agents
ramsey_model(instruments=(R),planner_discount=beta,planner_discount_latex_name=$\beta$);
//conduct stochastic simulations of the Ramsey problem
stoch_simul(order=1,irf=20,periods=500) pi_ann log_h R_ann log_C Z r_real;
evaluate_planner_objective;
function [ys,params,check] = Ramsey_steady_file_steadystate(ys,exo,M_,options_)
% function [ys,params,check] = Ramsey_steady_file_steadystate(ys,exo,M_,options_)
% computes the steady state for the Ramsey_steady_file.mod, conditional on
% the instrument value provided
%
% Inputs:
% - ys [vector] vector of initial values for the steady state of
% the endogenous variables
% - exo [vector] vector of values for the exogenous variables
% - M_ [structure] Dynare model structure
% - options [structure] Dynare options structure
%
% Output:
% - ys [vector] vector of steady state values for the the endogenous variables
% - params [vector] vector of parameter values
% - check [scalar] set to 0 if steady state computation worked and to
% 1 of not (allows to impose restrictions on parameters)
% Copyright © 2020 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
% read out parameters to access them with their name
beta=NaN; %make parameter known to Matlab function, prevents crashes due to Matlab function with same name;
%will be overwritten next
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
paramname = M_.param_names{ii};
eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
% read in instrument values
for ii = 1:size(options_.instruments,1)
eval([options_.instruments{ii} ' = ys(strmatch(options_.instruments{ii},M_.endo_names,''exact'')) ;']);
end
% initialize indicator
check = 0;
%% Enter model equations here
Z=0;
pi=(R+1)*beta;
C=sqrt((1+1/theta*((1-beta)*(pi-1)*pi-(tau-1/(theta-1))*(1-theta)))/(chi*(1+phi/2*(pi-1)^2)));
h=C*(1+phi/2*(pi-1)^2);
log_C=log(C);
log_h=log(h);
pi_ann=4*log(pi);
R_ann=4*R;
r_real=4*log((1+R)/pi);
y_nat=sqrt((theta-1)/theta*(1+tau)/chi);
y_gap=log_C-log(y_nat);
%% end own model equations
params=NaN(NumberOfParameters,1);
for iter = 1:length(M_.params) %update parameters set in the file
eval([ 'params(' num2str(iter) ') = ' M_.param_names{iter} ';' ])
end
NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
varname = M_.endo_names{ii};
eval(['ys(' int2str(ii) ') = ' varname ';']);
end
/*
* This file replicates the model studied in:
* Aguiar, Mark and Gopinath, Gita (2004): "Emerging Market Business Cycles:
* The Cycle is the Trend" (NBER WP 10734). It is different from version published
* Aguiar, Mark and Gopinath, Gita (2004): “Emerging Market Business Cycles:
* The Cycle is the Trend(NBER WP 10734). It is different from version published
* in the Journal of Political Economy.
*
* This model file is intended to show the capabilities of the Dynare macro
......@@ -15,13 +15,13 @@
* The mod-file reproduces Figure 4 of the working paper, which displays the
* model response to 1 percent shock to trend and cyclical TFP.
*
* This implementation was written by Sbastien Villemot and Johannes Pfeifer.
* This implementation was written by Sébastien Villemot and Johannes Pfeifer.
* Please note that the following copyright notice only applies to this Dynare
* implementation of the model.
*/
/*
* Copyright (C) 2012-13 Dynare Team
* Copyright © 2012-13 Dynare Team
*
* This file is part of Dynare.
*
......@@ -36,7 +36,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
......
......@@ -27,7 +27,7 @@
*/
/*
* Copyright (C) 2010 Dynare Team
* Copyright © 2010 Dynare Team
*
* This file is part of Dynare.
*
......@@ -42,7 +42,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
@#define countries = [ "H", "F" ]
......
Assuming that the dynare++ binary is in your PATH, you can run the example by using the following command
in a Command Prompt Window:
... > dynare++ example1.mod
Please, read the manual (doc\dynare++\dynare++-tutorial.pdf) for a description of the generated output.
/*
* This Dynare++ mod-file implements the RBC model with time-to-build
* described in Kamenik (2011): "DSGE Models with Dynare++. A Tutorial."
* Note that Dynare++ uses the same stock-at-the-end-of-period timing convention
* as the regular Dynare
*/
var Y, C, K, A, H, B;
varexo EPS, NU;
parameters beta, rho, alpha, delta, theta, psi, tau;
alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 1/(1.03^0.25);
delta = 0.025;
psi = 0;
theta = 2.95;
model;
C*theta*H^(1+psi) = (1-alpha)*Y;
beta*exp(B)*C/exp(B(1))/C(1)*
(exp(B(1))*alpha*Y(1)/K(1)+1-delta) = 1;
Y = exp(A)*K^alpha*H^(1-alpha);
K = exp(B(-1))*(Y(-1)-C(-1)) + (1-delta)*K(-1);
A = rho*A(-1) + tau*B(-1) + EPS;
B = tau*A(-1) + rho*B(-1) + NU;
end;
initval;
A = 0;
B = 0;
H = ((1-alpha)/(theta*(1-(delta*alpha)/(1/beta-1+delta))))^(1/(1+psi));
Y = (alpha/(1/beta-1+delta))^(alpha/(1-alpha))*H;
K = alpha/(1/beta-1+delta)*Y;
C = Y - delta*K;
end;
vcov = [0.0002 0.00005;
0.00005 0.0001
];
order = 7;
\ No newline at end of file
......@@ -4,7 +4,7 @@
*/
/*
* Copyright (C) 2001-2010 Dynare Team
* Copyright © 2001-2010 Dynare Team
*
* This file is part of Dynare.
*
......@@ -19,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
......
......@@ -4,7 +4,7 @@
*/
/*
* Copyright (C) 2001-2015 Dynare Team
* Copyright © 2001-2015 Dynare Team
*
* This file is part of Dynare.
*
......@@ -19,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
......
......@@ -4,7 +4,7 @@
*/
/*
* Copyright (C) 2001-2010 Dynare Team
* Copyright © 2001-2010 Dynare Team
*
* This file is part of Dynare.
*
......@@ -19,7 +19,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
......
......@@ -6,7 +6,7 @@
* To do so, the equations of the model have been transformed into a non-linear equation in
* labor h. Within the steady_state_model-block, a helper function is called that uses fsolve
* to solve this non-linear equation. The use of the helper function is necessary to avoid
* interference of the Matlab syntax with Dynare's preprocessor. A more complicated alternative
* interference of the MATLAB syntax with Dynare's preprocessor. A more complicated alternative
* that provides more flexibility in the type of commands executed and functions called is the use
* of an explicit steady state file. See the NK_baseline.mod in the Examples Folder.
*
......@@ -16,7 +16,7 @@
*/
/*
* Copyright (C) 2013 Dynare Team
* Copyright © 2013 Dynare Team
*
* This file is part of Dynare.
*
......@@ -31,7 +31,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
......
......@@ -3,20 +3,20 @@
* in the paper) described in Frank Schorfheide (2000): "Loss function-based
* evaluation of DSGE models", Journal of Applied Econometrics, 15(6), 645-670.
*
* The data are in file "fsdat_simul.m", and have been artificially generated.
* They are therefore different from the original dataset used by Schorfheide.
* The data are taken from the replication package at
* http://dx.doi.org/10.15456/jae.2022314.0708799949
*
* The prior distribution follows the one originally specified in Schorfheide's
* paper, except for parameter rho. In the paper, the elicited beta prior for rho
* paper. Note that the elicited beta prior for rho in the paper
* implies an asymptote and corresponding prior mode at 0. It is generally
* recommended to avoid this extreme type of prior. Some optimizers, for instance
* mode_compute=12 (Mathworks' particleswarm algorithm) may find a posterior mode
* with rho equal to zero. We lowered the value of the prior standard deviation
* (changing .223 to .100) to remove the asymptote.
* recommended to avoid this extreme type of prior.
*
* Because the data are already logged and we use the loglinear option to conduct
* a full log-linearization, we need to use the logdata option.
*
* The equations are taken from J. Nason and T. Cogley (1994): "Testing the
* implications of long-run neutrality for monetary business cycle models",
* Journal of Applied Econometrics, 9, S37-S70.
* Journal of Applied Econometrics, 9, S37-S70, NC in the following.
* Note that there is an initial minus sign missing in equation (A1), p. S63.
*
* This implementation was originally written by Michel Juillard. Please note that the
......@@ -25,7 +25,7 @@
*/
/*
* Copyright (C) 2004-2017 Dynare Team
* Copyright © 2004-2023 Dynare Team
*
* This file is part of Dynare.
*
......@@ -40,36 +40,74 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
var m P c e W R k d n l gy_obs gp_obs y dA;
varexo e_a e_m;
parameters alp bet gam mst rho psi del;
var m ${m}$ (long_name='money growth')
P ${P}$ (long_name='Price level')
c ${c}$ (long_name='consumption')
e ${e}$ (long_name='capital stock')
W ${W}$ (long_name='Wage rate')
R ${R}$ (long_name='interest rate')
k ${k}$ (long_name='capital stock')
d ${d}$ (long_name='dividends')
n ${n}$ (long_name='labor')
l ${l}$ (long_name='loans')
gy_obs ${\Delta \ln GDP}$ (long_name='detrended capital stock')
gp_obs ${\Delta \ln P}$ (long_name='detrended capital stock')
y ${y}$ (long_name='detrended output')
dA ${\Delta A}$ (long_name='TFP growth')
;
varexo e_a ${\epsilon_A}$ (long_name='TFP shock')
e_m ${\epsilon_M}$ (long_name='Money growth shock')
;
parameters alp ${\alpha}$ (long_name='capital share')
bet ${\beta}$ (long_name='discount factor')
gam ${\gamma}$ (long_name='long-run TFP growth')
logmst ${\log(m^*)}$ (long_name='long-run money growth')
rho ${\rho}$ (long_name='autocorrelation money growth')
phi ${\phi}$ (long_name='labor weight in consumption')
del ${\delta}$ (long_name='depreciation rate')
;
% roughly picked values to allow simulating the model before estimation
alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
logmst = log(1.011);
rho = 0.7;
psi = 0.787;
phi = 0.787;
del = 0.02;
model;
[name='NC before eq. (1), TFP growth equation']
dA = exp(gam+e_a);
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
[name='NC eq. (2), money growth rate']
log(m) = (1-rho)*logmst + rho*log(m(-1))+e_m;
[name='NC eq. (A1), Euler equation']
-P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*exp(-alp*(gam+log(e(+1))))*k^(alp-1)*n(+1)^(1-alp)+(1-del)*exp(-(gam+log(e(+1)))))/(c(+2)*P(+2)*m(+1))=0;
[name='NC below eq. (A1), firm borrowing constraint']
W = l/n;
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
[name='NC eq. (A2), intratemporal labour market condition']
-(phi/(1-phi))*(c*P/(1-n))+l/n = 0;
[name='NC below eq. (A2), credit market clearing']
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
[name='NC eq. (A3), credit market optimality']
1/(c*P)-bet*P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0;
[name='NC eq. (18), aggregate resource constraint']
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
[name='NC eq. (19), money market condition']
P*c = m;
[name='NC eq. (20), credit market equilibrium condition']
m-1+d = l;
[name='Definition TFP shock']
e = exp(e_a);
[name='Implied by NC eq. (18), production function']
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
[name='Observation equation GDP growth']
gy_obs = dA*y/y(-1);
[name='Observation equation price level']
gp_obs = (P/P(-1))*m(-1)/dA;
end;
......@@ -81,19 +119,19 @@ end;
steady_state_model;
dA = exp(gam);
gst = 1/dA;
m = mst;
m = exp(logmst);
khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );
xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/m )^(-1);
nust = phi*m^2/( (1-alp)*(1-phi)*bet*gst^alp*khst^alp );
n = xist/(nust+xist);
P = xist + nust;
k = khst*n;
l = psi*mst*n/( (1-psi)*(1-n) );
c = mst/P;
d = l - mst + 1;
l = phi*m*n/( (1-phi)*(1-n) );
c = m/P;
d = l - m + 1;
y = k^alp*n^(1-alp)*gst^alp;
R = mst/bet;
R = m/bet;
W = l/n;
ist = y-c;
q = 1 - d;
......@@ -104,17 +142,18 @@ steady_state_model;
gy_obs = dA;
end;
steady;
steady;
check;
% Table 1 of Schorfheide (2000)
estimated_params;
alp, beta_pdf, 0.356, 0.02;
bet, beta_pdf, 0.993, 0.002;
gam, normal_pdf, 0.0085, 0.003;
mst, normal_pdf, 1.0002, 0.007;
rho, beta_pdf, 0.129, 0.100;
psi, beta_pdf, 0.65, 0.05;
logmst, normal_pdf, 0.0002, 0.007;
rho, beta_pdf, 0.129, 0.223;
phi, beta_pdf, 0.65, 0.05;
del, beta_pdf, 0.01, 0.005;
stderr e_a, inv_gamma_pdf, 0.035449, inf;
stderr e_m, inv_gamma_pdf, 0.008862, inf;
......@@ -122,14 +161,8 @@ end;
varobs gp_obs gy_obs;
estimation(order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8);
/*
* The following lines were used to generate the data file. If you want to
* generate another random data file, comment the "estimation" line and uncomment
* the following lines.
*/
estimation(order=1, datafile=fs2000_data, loglinear,logdata, mode_compute=4, mh_replic=20000, nodiagnostic, mh_nblocks=2, mh_jscale=0.8, mode_check);
//stoch_simul(periods=200, order=1);
//datatomfile('fsdat_simul', char('gy_obs', 'gp_obs'));
%uncomment the following lines to generate LaTeX-code of the model equations
%write_latex_original_model(write_equation_tags);
%collect_latex_files;
%This file is a direct Matlab implementation of the loaddata.g and data.prn files
%of Schorfheide, Frank (2000): Loss function-based evaluation of DSGE models
%(replication data). Version: 1. Journal of Applied Econometrics. Dataset.
%http://dx.doi.org/10.15456/jae.2022314.0708799949
% Copyright: 2000-2022 Frank Schorfheide
% Copyright: 2023 Dynare Team
% License: CC BY 4.0
% (https://creativecommons.org/licenses/by/4.0/legalcode)
% Time series, extracted 05/04/00
% columms are quarterly data from 1949:IV to 1997:IV
% 1: GDPD = GROSS DOMESTIC PRODUCT:IMPLICIT PRICE DEFLATOR (INDEX,92=100)(T7.1)
% 2: GDPQ = GROSS DOMESTIC PRODUCT
% 3: GPOP = POPULATION, NIPA basis (THOUS.,NSA)
data_q=[18.02 1474.5 150.2
17.94 1538.2 150.9
18.01 1584.5 151.4
18.42 1644.1 152
18.73 1678.6 152.7
19.46 1693.1 153.3
19.55 1724 153.9
19.56 1758.2 154.7
19.79 1760.6 155.4
19.77 1779.2 156
19.82 1778.8 156.6
20.03 1790.9 157.3
20.12 1846 158
20.1 1882.6 158.6
20.14 1897.3 159.2
20.22 1887.4 160
20.27 1858.2 160.7
20.34 1849.9 161.4
20.39 1848.5 162
20.42 1868.9 162.8
20.47 1905.6 163.6
20.56 1959.6 164.3
20.62 1994.4 164.9
20.78 2020.1 165.7
21 2030.5 166.5
21.2 2023.6 167.2
21.33 2037.7 167.9
21.62 2033.4 168.7
21.71 2066.2 169.5
22.01 2077.5 170.2
22.15 2071.9 170.9
22.27 2094 171.7
22.29 2070.8 172.5
22.56 2012.6 173.1
22.64 2024.7 173.8
22.77 2072.3 174.5
22.88 2120.6 175.3
22.92 2165 176.045
22.91 2223.3 176.727
22.94 2221.4 177.481
23.03 2230.95 178.268
23.13 2279.22 179.694
23.22 2265.48 180.335
23.32 2268.29 181.094
23.4 2238.57 181.915
23.45 2251.68 182.634
23.51 2292.02 183.337
23.56 2332.61 184.103
23.63 2381.01 184.894
23.75 2422.59 185.553
23.81 2448.01 186.203
23.87 2471.86 186.926
23.94 2476.67 187.68
24 2508.7 188.299
24.07 2538.05 188.906
24.12 2586.26 189.631
24.29 2604.62 190.362
24.35 2666.69 190.954
24.41 2697.54 191.56
24.52 2729.63 192.256
24.64 2739.75 192.938
24.77 2808.88 193.467
24.88 2846.34 193.994
25.01 2898.79 194.647
25.17 2970.48 195.279
25.32 3042.35 195.763
25.53 3055.53 196.277
25.79 3076.51 196.877
26.02 3102.36 197.481
26.14 3127.15 197.967
26.31 3129.53 198.455
26.6 3154.19 199.012
26.9 3177.98 199.572
27.21 3236.18 199.995
27.49 3292.07 200.452
27.75 3316.11 200.997
28.12 3331.22 201.538
28.39 3381.86 201.955
28.73 3390.23 202.419
29.14 3409.65 202.986
29.51 3392.6 203.584
29.94 3386.49 204.086
30.36 3391.61 204.721
30.61 3422.95 205.419
31.02 3389.36 206.13
31.5 3481.4 206.763
31.93 3500.95 207.362
32.27 3523.8 208
32.54 3533.79 208.642
33.02 3604.73 209.142
33.2 3687.9 209.637
33.49 3726.18 210.181
33.95 3790.44 210.737
34.36 3892.22 211.192
34.94 3919.01 211.663
35.61 3907.08 212.191
36.29 3947.11 212.708
37.01 3908.15 213.144
37.79 3922.57 213.602
38.96 3879.98 214.147
40.13 3854.13 214.7
41.05 3800.93 215.135
41.66 3835.21 215.652
42.41 3907.02 216.289
43.19 3952.48 216.848
43.69 4044.59 217.314
44.15 4072.19 217.776
44.77 4088.49 218.338
45.57 4126.39 218.917
46.32 4176.28 219.427
47.07 4260.08 219.956
47.66 4329.46 220.573
48.63 4328.33 221.201
49.42 4345.51 221.719
50.41 4510.73 222.281
51.27 4552.14 222.933
52.35 4603.65 223.583
53.51 4605.65 224.152
54.65 4615.64 224.737
55.82 4644.93 225.418
56.92 4656.23 226.117
58.18 4678.96 226.754
59.55 4566.62 227.389
61.01 4562.25 228.07
62.59 4651.86 228.689
64.15 4739.16 229.155
65.37 4696.82 229.674
66.65 4753.02 230.301
67.87 4693.76 230.903
68.86 4615.89 231.395
69.72 4634.88 231.906
70.66 4612.08 232.498
71.44 4618.26 233.074
72.08 4662.97 233.546
72.83 4763.57 234.028
73.48 4849 234.603
74.19 4939.23 235.153
75.02 5053.56 235.605
75.58 5132.87 236.082
76.25 5170.34 236.657
76.81 5203.68 237.232
77.63 5257.26 237.673
78.25 5283.73 238.176
78.76 5359.6 238.789
79.45 5393.57 239.387
79.81 5460.83 239.861
80.22 5466.95 240.368
80.84 5496.29 240.962
81.45 5526.77 241.539
82.09 5561.8 242.009
82.68 5618 242.52
83.33 5667.39 243.12
84.09 5750.57 243.721
84.67 5785.29 244.208
85.56 5844.05 244.716
86.66 5878.7 245.354
87.44 5952.83 245.966
88.45 6010.96 246.46
89.39 6055.61 247.017
90.13 6087.96 247.698
90.88 6093.51 248.374
92 6152.59 248.928
93.18 6171.57 249.564
94.14 6142.1 250.299
95.11 6078.96 251.031
96.27 6047.49 251.65
97 6074.66 252.295
97.7 6090.14 253.033
98.31 6105.25 253.743
99.13 6175.69 254.338
99.79 6214.22 255.032
100.17 6260.74 255.815
100.88 6327.12 256.543
101.84 6327.93 257.151
102.35 6359.9 257.785
102.83 6393.5 258.516
103.51 6476.86 259.191
104.13 6524.5 259.738
104.71 6600.31 260.351
105.39 6629.47 261.04
106.09 6688.61 261.692
106.75 6717.46 262.236
107.24 6724.2 262.847
107.75 6779.53 263.527
108.29 6825.8 264.169
108.91 6882 264.681
109.24 6983.91 265.258
109.74 7020 265.887
110.23 7093.12 266.491
111 7166.68 266.987
111.43 7236.5 267.545
111.76 7311.24 268.171
112.08 7364.63 268.815];
%Compute growth rates: from 1950:I to 1997:IV
gy_obs=1000*data_q(:,2)./data_q(:,3); %real GDP per capita
gy_obs=diff(log(gy_obs));
gp_obs = diff(log(data_q(:,1))); %GDP deflator inflation
......@@ -8,7 +8,7 @@
*/
/*
* Copyright (C) 2004-2015 Dynare Team
* Copyright © 2004-2015 Dynare Team
*
* This file is part of Dynare.
*
......@@ -23,7 +23,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
var gM gA;
......