Help converting this short code from dynare 4.5.7 to the current version

Hi, this is the following code : please help me with your suggestions .
The data used in this example and the file.mod are here : https://drive.google.com/drive/folders/1pSTki0nJRLY24bE0VevP-mM99ayUbgmO?usp=sharing

Thanks in advance

% Super simple model
% - log-linearised variant using equations from the slides
% - includes observed variables that are stored in ‘imf_data.xlsx’
% - observed variables are y_obs pi_obs r_obs and treated as endogenous
% - measurement equations for variables are included in the model
% - allow for measurement error for output, but not the others
% - some of the parameters are estimated (starting with shocks)
% - includes a shock to technology and monetary policy
% - size of shock to technology is calibrated
% - steady-state block is not necessary (linearised around mean of zero)
% - estimation command includes very short Markov-chain
%%

close all;

var y_t c_t k_t a_t r_t pi_t y_obs pi_obs r_obs;

varexo eps_a eps_r eps_y_obs;

parameters beta_p delta_p alpha_p rhoa_p phi_pi_p;

alpha_p = 0.33; % capital share
delta_p = 0.025; % deprecation rate
beta_p = 0.99; % discount factor
phi_pi_p = 1.5; % central bank response to inflation
rhoa_p = 0.97; % TFP persistence

model(linear);
#k_ss = ((1/beta_p-(1-delta_p))/alpha_p)^(1/(alpha_p-1)); % used in budget constraint
#y_ss = k_ss^alpha_p; % used in budget constraint
#c_ss = y_ss-delta_pk_ss; % used in budget constraint
-c_t = -c_t(+1) + beta_p
alpha_pk_ss^(alpha_p-1)(a_t(+1)+(alpha_p-1)k_t); % Euler 1
-c_t = -c_t(+1) + r_t - pi_t(+1); % Euler 2
y_ss
y_t = c_ssc_t + k_ssk_t - (1-delta_p)k_ssk_t(-1); % Budget constraint
y_t = a_t + alpha_pk_t(-1); % Production function
r_t = phi_pi_p
pi_t + eps_r; % Monetary rule
a_t = rhoa_p*a_t(-1) + eps_a; % Technology shock
y_obs = y_t + eps_y_obs; % Output measurement equation
pi_obs = pi_t; % Inflation measurement equation
r_obs = r_t; % Interest rate measurement equation
end;

varobs y_obs pi_obs r_obs;

steady_state_model;
k_t=0;
y_t=0;
c_t=0;
r_t=0;
pi_t=0;
a_t=0;
end;

estimated_params;
phi_pi_p, gamma_pdf, 1.5, 0.005;
stderr eps_r, inv_gamma_pdf, 0.0005, inf;
stderr eps_y_obs, inv_gamma_pdf, 0.005, inf;
end;

shocks;
var eps_a; stderr 0.01;
end;

steady;
check;

estimation(datafile=‘imf_data.xlsx’, mh_replic=2000, mh_nblocks=1, mh_drop=0.45);
%stoch_simul(order=1, irf=20, periods=250);

Your code is compatible with Dynare 4.6. No changes are needed.

1 Like

Thank you so much, have a nice day