Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
dynare
Commits
e001d448
Commit
e001d448
authored
Sep 29, 2017
by
Stéphane Adjemian
Browse files
Return an error if Newton fails when simulating a backward model.
parent
51fd3fd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/backward/simul_backward_nonlinear_model_.m
View file @
e001d448
...
...
@@ -48,7 +48,11 @@ end
for
it
=
initialconditions
.
nobs
+
(
1
:
samplesize
)
ylag
=
DynareOutput
.
endo_simul
(
iy1
,
it
-
1
);
% Set lagged variables.
y
=
DynareOutput
.
endo_simul
(:,
it
-
1
);
% A good guess for the initial conditions is the previous values for the endogenous variables.
DynareOutput
.
endo_simul
(:,
it
)
=
dynare_solve
(
model_dynamic_s
,
y
,
DynareOptions
,
model_dynamic
,
ylag
,
DynareOutput
.
exo_simul
,
DynareModel
.
params
,
DynareOutput
.
steady_state
,
it
);
[
DynareOutput
.
endo_simul
(:,
it
),
info
,
fvec
]
=
dynare_solve
(
model_dynamic_s
,
...
y
,
DynareOptions
,
model_dynamic
,
ylag
,
DynareOutput
.
exo_simul
,
DynareModel
.
params
,
DynareOutput
.
steady_state
,
it
);
if
info
error
(
'Newton failed!'
)
end
end
ysim
=
DynareOutput
.
endo_simul
(
1
:
DynareModel
.
orig_endo_nbr
,:);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment