Replication DSGE Model with Cryptocurrency

Hey everybody,

I want to replicate a DSGE model with cryptocurrency, but I stuck at the parameter decleration. When I try to run the code I receive the following error message “Symbol xi declared twice with different types”. Since I’m a beginner with such a replication I’m really pleased if someone could help me.

The model code is:

yhat = yhat(+1) - omega1*(rhat - pihat(+1)) + omega2*((mghat - eg) - (mghat(+1) - eg(+1))) + omega3*((chihat + mchat - ec)-(chihat(+1) + mchat(+1) - ec(+1))) + omega1*(a - a(+1));

mghat = gamma1yhat - gamma2rhat + gamma3eg - gammy4chihat - gammy4mchat + gamma4ec;

mchat = gamma5yhat - gamma6rhat + gamma7ec - gammy8chihat - gammy8mghat + gamma8eg;

pihat = (pi_ss/r_ss)pihat(+1) + psi((1/omega1)yhat - (omega2/omega1)(mghat-eg) - (omega3/omega1)*(chihat + mchat - ec) - z);

chihat = -varroh*phihat

phihat = (xi_ss/phi_ss)*xi + (1-(xi_ss/phi_ss)*nu

rhat = rhor*rhat(-1) + (1-rhor)rhoyyhat + (1-rhor)rhopipihat + (1-rhor)rhomugmughat + eps_r;

a = rhoa*a(-1) + eps_a;

eg = rhoeg*eg(-1) + eps_eg;

ec = rhoec*ec(-1) + eps_ec;

xi = rhoxi*xi(-1) + eps_xi;

nu = rhonu*nu(-1) + eps_nu;

z = rhoz*z(-1) + eps_z;

Model Equations and Parameters.pdf (303.0 KB)

ALR_rep_2.mod (11.3 KB)

Best regards,
Renate

You have twice

    xi     ${xi}$          (long_name='AR(1) common supply shock (productivity of entrepreneur via the common component)')


in line 25 and 40. Moreover, in line 70

    xi/phi    ${\xi/phi}$    (log_name='Share of Crypto. Common Prod. on Crypto. Tot. Prod.')


this is not a valid parameter name. Use e.g. xi_phi.

Hello Mr. Pfeifer,

thank you for your response. I changed the name of the parameter and so fare the Dynare code should be ready to run the replication. When I try to run the run code I receive the following error message:

Error using dynare (line 282)
Dynare: preprocessing failed

ALR_rep.mod (11.3 KB)

Please can you tell me what is this error message about and how I can solve the problem?

Thank you and best regards,
Renate

Hi Renate,

there are a couple of parameters in your code undefined for Dynare.

gammy4 and gammy8 in the model block are likely to be typos and should be gamma4 and gamma8, instead.
varroh in the model block should be varrho.
psi is not defined and calibrated at all.

mughat might be the endogenous variable mghat?

Hi Max1,

thank you for your quick replay. I corrected the undefined parameters but now I’m facing a new problem. When I run the code I receive following error message:

dynare ALR_rep_4.mod
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Found 13 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

Warning: Some of the parameters have no value (omega1, xi_phi, pi_ss, r_ss, xi_ss, phi_ss, mughat, psi) when using steady. If these parameters are not
initialized in a steadystate file or a steady_state_model-block, Dynare may not be able to solve the model…
STEADY: numerical initial values or parameters incompatible with the following equations
1 4 6 7

Check whether your model is truly linear. Put “resid(1);” before “steady;” to see the problematic equations.

Residuals of the static equations:

Equation number 1 : NaN : Log-linearized Euler equation (18)
Equation number 2 : NaN : Money demand relationship for government currency (19)
Equation number 3 : NaN : Money demand relationship for cryptocurrency (20)
Equation number 4 : NaN : Forward-looking Phillips curve (21)
Equation number 5 : NaN : Log-linerarized FOC derived from the profit maximization problem (22)
Equation number 6 : NaN : Log-linerarized expression for the entrepreneurs productivity that depends on the common producticity in the cryptocurrency sector as well as on the specific productivity of the EN (23)
Equation number 7 : NaN : Log-linerarized Monetary Policy Rule (24)
Equation number 8 : 0 : temporary preference shock to the IS curve (3)
Equation number 9 : 0 : temporary preference shock on money demand to government money (4)
Equation number 10 : 0 : temporary preference shock on money demand to cryptocurrency (5)
Equation number 11 : 0 : temporary prefernece shock on the productivity of the other entrepreneuer via common component (6)
Equation number 12 : 0 : temporary preference shock on the specific programming skills of the entrepreneur (7)
Equation number 13 : 0 : temporary technology shock (productivity shock) (14)

Error using print_info (line 32)
The steady state has NaNs or Inf.

print_info(info,options_.noprint, options_);

Error in ALR_rep_4.driver (line 375)

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

I know that the problem are the following parameter: omega1, xi_phi, pi_ss, r_ss, xi_ss, phi_ss, mughat, psi. Since these parameter are part of the model equations, I added them at the list of delcered parameters but the problem which I’m facing now is that I don’t have estimated values for them.

ALR_rep_4.mod (11.5 KB)

Please can you tell me how I can solve such a problem?

Thank you and best regards,
Renate

you have to calibrate these parameters. trying to email the authers