Hi,
I am trying to introduce my graduate students to Dynare in Julia. However, I am having the following problems obtaining the coefficients for the policy functions and the IRF graphs.
My model is the classical example 1 from Collard (2001):
var y, c, k, a, h, b;
varexo e, u;
parameters beta, rho, alpha, delta, theta, psi, tau, phi;
alpha = 0.36; rho = 0.95; tau = 0.025; beta = 0.99; delta = 0.025; psi = 0; theta = 2.95; phi = 0.1;
model;
cthetah^(1+psi)=(1-alpha)y;
k = beta(((exp(b)c)/(exp(b(+1))c(+1))) (exp(b(+1))alphay(+1)+(1-delta)k));
y = exp(a)(k(-1)^alpha)(h^(1-alpha));
k = exp(b)(y-c)+(1-delta)k(-1);
a = rhoa(-1)+taub(-1) + e;
b = taua(-1)+rhob(-1) + u;
end;
initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
a = 0;
b = 0;
e = 0;
u = 0;
end;
shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi0.0090.009;
end;
steady;
stoch_simul(order = 1, irf=40) y c;
The problem is that when I run the following line of code
@dynare “XXXX/Stochastic_simulation_two.mod”, I obtain the following result, which has no tables for policy functions, and also, I don’t get any IRF or graph in the folder that is created.
Do you know how to solve this?
Here is the output that I get in Julia
Dynare version: 0.9.18
2025-01-15T19:14:44.246: Starting @dynare /Users/alejandrorojas/Dropbox/U Hawaii Manoa/Courses/ECON 662/Slides/Lecture 5 - The Open Economy RBC/Dynare/Stochastic_simulation_two.mod
[“Stochastic_simulation_two.mod”, “language=julia”, “json=compute”]
Dynare preprocessor version: 6.4.0+0
Starting preprocessing of the model file …
Found 6 equation(s).
Evaluating expressions…
Computing static model derivatives (order 1).
Normalizing the static model…
Finding the optimal block decomposition of the static model…
2 block(s) found:
0 recursive block(s) and 2 simultaneous block(s).
the largest simultaneous block has 4 equation(s)
and 4 feedback variable(s).
Computing dynamic model derivatives (order 1).
Normalizing the dynamic model…
Finding the optimal block decomposition of the dynamic model…
2 block(s) found:
0 recursive block(s) and 2 simultaneous block(s).
the largest simultaneous block has 4 equation(s)
and 4 feedback variable(s).
JSON written after Computing step.
Preprocessing completed.
2025-01-15T19:14:44.270: End of preprocessing
2025-01-15T19:14:44.275: Start parse_statements!
ErrorException(“Unrecognized statement native 1.mod”)
2025-01-15T19:14:44.278: End parser
Context(Dict{String, DynareSymbol}(“psi” => longname: psi
texname: psi
symboltype: Parameter
orderintype: 6
, “c” => longname: c
texname: c
symboltype: Endogenous
orderintype: 2
, “e” => longname: e
texname: e
symboltype: Exogenous
orderintype: 1
, “b” => longname: b
texname: b
symboltype: Endogenous
orderintype: 6
, “tau” => longname: tau
texname: tau
symboltype: Parameter
orderintype: 7
, “a” => longname: a
texname: a
symboltype: Endogenous
orderintype: 4
, “h” => longname: h
texname: h
symboltype: Endogenous
orderintype: 5
, “delta” => longname: delta
texname: delta
symboltype: Parameter
orderintype: 4
, “theta” => longname: theta
texname: theta
symboltype: Parameter
orderintype: 5
, “phi” => longname: phi
texname: phi
symboltype: Parameter
orderintype: 8
…), Model[endogenous_nbr: 6
exogenous_nbr: 2
lagged_exogenous_nbr: 0
exogenous_deterministic_nbr: 0
parameter_nbr: 8
original_endogenous_nbr: 6
lead_lag_incidence: [0 0 1 2 0 3; 4 5 6 7 8 9; 10 11 0 0 0 12]
n_static: 1
n_fwrd: 2
n_bkwrd: 2
n_both: 1
n_states: 3
DErows1: [1, 2, 3, 4, 5]
DErows2: [6]
n_dyn: 6
i_static: [5]
i_dyn: [1, 2, 3, 4, 6]
i_bkwrd: [3, 4]
i_bkwrd_b: [3, 4, 6]
i_bkwrd_ns: [3, 4, 5]
i_fwrd: [1, 2]
i_fwrd_b: [1, 2, 6]
i_fwrd_ns: [1, 2, 5]
i_both: [6]
i_non_states: [1, 2, 5]
p_static: [8]
p_bkwrd: [1, 2]
p_bkwrd_b: [1, 2, 3]
p_fwrd: [10, 11]
p_fwrd_b: [10, 11, 12]
p_both_b: [3]
p_both_f: [12]
i_current: [1, 2, 3, 4, 5, 6]
p_current: [4, 5, 6, 7, 8, 9]
n_current: 6
i_current_ns: [1, 2, 3, 4, 5]
p_current_ns: [4, 5, 6, 7, 9]
n_current_ns: 5
icolsD: [1, 2, 4, 5, 6]
jcolsD: [6, 7, 10, 11, 12]
icolsE: [1, 2, 3, 4, 5, 6]
jcolsE: [1, 2, 3, 4, 5, 9]
colsUD: [3]
colsUE: [6]
i_cur_fwrd: [1, 2, 3]
n_cur_fwrd: 3
p_cur_fwrd: [4, 5, 9]
i_cur_bkwrd: [1, 2]
n_cur_bkwrd: 2
p_cur_bkwrd: [6, 7]
i_cur_both: [1]
n_cur_both: 1
p_cur_both: [9]
gx_rows: [4, 5, 6]
hx_rows: [1, 2, 3]
i_current_exogenous: [13, 14]
i_lagged_exogenous: Int64
serially_correlated_exogenous: Int64
Sigma_e: [0.0 0.0; 0.0 0.0]
maximum_endo_lag: 1
maximum_endo_lead: 1
maximum_exo_lag: 0
maximum_exo_lead: 0
maximum_exo_det_lag: 0
maximum_exo_det_lead: 0
maximum_lag: 1
maximum_lead: 1
orig_maximum_endo_lag: 1
orig_maximum_endo_lead: 1
orig_maximum_exo_lag: 0
orig_maximum_exo_lead: 0
orig_maximum_exo_det_lag: 0
orig_maximum_exo_det_lead: 0
orig_maximum_lag: 1
orig_maximum_lead: 1
dynamic_indices: [1, 2, 3, 4, 6]
current_dynamic_indices: [1, 2, 3, 4, 6]
forward_indices_d: [1, 2]
backward_indices_d: [3, 4]
current_dynamic_indices_d: [1, 2, 3, 4, 5]
exogenous_indices: [13, 14]
NNZDerivatives: [26, -1, -1]
auxiliary_variables: Dict{String, Any}
mcps: Tuple{Int64, Int64, String, String}
dynamic_g1_sparse_rowval: [3, 4, 5, 6, 5, 6, 1, 3, 4, 1, 2, 4, 2, 4, 3, 5, 1, 3, 2, 4, 6, 2, 2, 2, 5, 6]
dynamic_g1_sparse_colptr: [1, 1, 1, 3, 5, 5, 7, 10, 13, 15, 17, 19, 22, 23, 24, 24, 24, 24, 25, 26, 27]
dynamic_g2_sparse_indices: Vector{Int64}
static_g1_sparse_rowval: [1, 2, 3, 4, 1, 4, 2, 3, 4, 3, 5, 6, 1, 3, 2, 4, 5, 6]
static_g1_sparse_colptr: [1, 5, 7, 10, 13, 15, 19]
dynamic_tmp_nbr: [5, 0, 0, 0]
static_tmp_nbr: [4, 0, 0, 0]
ids: LinearRationalExpectations.Indices([1, 2, 3, 4, 5, 6], [1, 2, 6], [1, 2], [3, 4, 6], [6], [1, 2, 5], [5], [1, 2, 3, 4, 6], [1, 2, 3, 4, 6], [1, 2, 3, 4, 5], [1, 2, 5], [3, 4, 5], [4, 5, 6, 7, 9], [8], [13, 14], 6, (D = [1, 2, 3, 4, 5, 6], jacobian = [6, 7, 9, 10, 11, 12]), (E = [1, 2, 3, 4, 5], jacobian = [1, 2, 3, 4, 5]), [3], [6])
], endval_is_reset: false
has_auxiliary_variables: false
has_calib_smoother: false
has_check: false
has_deterministic_trend: false
has_dynamic_file: true
has_endval: false
has_histval: false
has_histval_file: false
has_initval: false
has_initval_file: false
has_planner_objective: false
has_perfect_foresight_setup: false
has_perfect_foresight_solver: false
has_ramsey_model: false
has_shocks: false
has_static_file: true
has_steadystate_file: false
has_stoch_simul: false
has_trends: false
initval_is_reset: false
modfilepath: /Users/alejandrorojas/Dropbox/U Hawaii Manoa/Courses/ECON 662/Slides/Lecture 5 - The Open Economy RBC/Dynare/Stochastic_simulation_two
, Results(ModelResults[irfs: Dict{Symbol, AxisArrayTable}()
endogenous_steady_state: Float64
endogenous_terminal_steady_state: Float64
endogenous_linear_trend: Float64
endogenous_quadratic_trend: Float64
exogenous_steady_state: [0.0, 0.0]
exogenous_terminal_steady_state: Float64
exogenous_linear_trend: Float64
exogenous_quadratic_trend: Float64
exogenous_det_steady_state: Float64
exogenous_det_terminal_steady_state: Float64
exogenous_det_linear_trend: Float64
exogenous_det_quadratic_trend: Float64
trends:
stationary_variables: Bool[1, 0, 0, 0, 0, 0]
estimation: Dynare.EstimationResults(Any, Any, Any, Any, Matrix{Any}(undef, 0, 0), Matrix{Any}(undef, 0, 0), 0)
filter:
forecast: AxisArrayTable
initial_smoother:
linearrationalexpectations: LinearRationalExpectations.LinearRationalExpectationsResults(ComplexF64, [0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0], [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0], [0.0 0.0; 0.0 0.0; 0.0 0.0], [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0], [0.0 0.0; 0.0 0.0; 0.0 0.0], [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0], [0.0 0.0; 0.0 0.0; 0.0 0.0; 0.0 0.0; 0.0 0.0; 0.0 0.0], [0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0 0.0], Bool[1, 0, 0, 0, 0, 0])
simulations: Simulation
smoother:
solution_derivatives: Matrix{Float64}
]), analytical_steadystate_variables: Int64
data:
datafile:
params: [6.97e-322, -3.785769322742054e-270, 3.126547902393613e-305, -8.78799053261415e-243, 4.456191161027e-312, 8.7324370789803e-310, -4.2905312075543e149, -0.0]
residuals: [2.5948427877e-314, 0.0, 0.0, 0.0, 5.0e-324, 0.0]
dynamic_variables: [0.0, 0.0, 1.5e-323, 0.0, 0.0, 1.5e-323, 5.0e-324, 0.0, 5.0e-324, 5.0e-324, 0.0, 5.0e-324]
exogenous_variables: [2.594483827e-314, 0.0, 0.0, 0.0, 5.0e-324, 0.0]
observed_variables: String
Sigma_m: Matrix{Float64}(undef, 0, 0)
jacobian: Matrix{Float64}(undef, 0, 0)
qr_jacobian: Matrix{Float64}(undef, 0, 0)
model_has_trend: Bool[0]
histval: Matrix{Union{Missing, Float64}}(undef, 0, 0)
homotopy_setup: @NamedTuple{name::Symbol, type::SymbolType, index::Int64, endvalue::Float64, startvalue::Union{Missing, Float64}}
initval_endogenous: Matrix{Union{Missing, Float64}}(undef, 0, 0)
initval_exogenous: Matrix{Union{Missing, Float64}}(undef, 0, 0)
initval_exogenous_deterministic: Matrix{Union{Missing, Float64}}(undef, 0, 0)
endval_endogenous: Matrix{Union{Missing, Float64}}(undef, 0, 0)
endval_exogenous: Matrix{Union{Missing, Float64}}(undef, 0, 0)
endval_exogenous_deterministic: Matrix{Union{Missing, Float64}}(undef, 0, 0)
scenario: Dict{Union{Int64, Dates.UTInstant}, Dict{Union{Int64, Dates.UTInstant}, Dict{Symbol, Pair{Float64, Symbol}}}}()
shocks: Float64
perfect_foresight_setup: Dict{String, Any}(“periods” => 0, “datafile” => “”)
estimated_parameters: Dynare.EstimatedParameters(Union{Int64, Pair{Int64, Int64}}, Union{Missing, Float64}, Float64, Union{Pair{String, String}, String}, Dynare.EstimatedParameterType, Float64, Float64, Float64, Float64, Float64, Float64, Distributions.Distribution)
, Dict{Any, Any}())