Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
b58eaa8e
Commit
b58eaa8e
authored
Nov 18, 2011
by
MichelJuillard
Browse files
introducing new test for 0/0 case in mjdgges
parent
1cd827b5
Changes
4
Show whitespace changes
Inline
Side-by-side
matlab/DsgeLikelihood.m
View file @
b58eaa8e
...
...
@@ -259,7 +259,7 @@ Model.H = H;
[
T
,
R
,
SteadyState
,
info
,
Model
,
DynareOptions
,
DynareResults
]
=
dynare_resolve
(
Model
,
DynareOptions
,
DynareResults
,
'
restrict
'
);
%
Return
,
with
endogenous
penalty
when
possible
,
if
dynare_resolve
issues
an
error
code
(
defined
in
resol
).
if
info
(
1
)
==
1
||
info
(
1
)
==
2
||
info
(
1
)
==
5
||
info
(
1
)
==
22
||
info
(
1
)
==
24
if
info
(
1
)
==
1
||
info
(
1
)
==
2
||
info
(
1
)
==
5
||
info
(
1
)
==
7
||
info
(
1
)
==
22
||
info
(
1
)
==
24
fval
=
penalty
+
1
;
info
=
info
(
1
);
exit_flag
=
0
;
...
...
matlab/dr1.m
View file @
b58eaa8e
...
...
@@ -290,9 +290,13 @@ else % use original Dynare solver
mexErrCheck
(
'mjdgges'
,
err
);
if
info1
if
info1
==
-
30
info
(
1
)
=
7
;
else
info
(
1
)
=
2
;
info
(
2
)
=
info1
;
info
(
3
)
=
size
(
e
,
2
);
end
return
end
...
...
matlab/print_info.m
View file @
b58eaa8e
...
...
@@ -49,7 +49,7 @@ if ~noprint
error
([
'The Jacobian matrix evaluated at the steady state contains elements '
...
'that are not real or are infinite'
])
case
7
error
([
'One of the eigenvalues is
is
close to 0/0 (the absolute '
...
error
([
'One of the eigenvalues is close to 0/0 (the absolute '
...
'value of numerator and denominator is smaller than 1e-6)'
])
case
19
error
(
'The steadystate file did not compute the steady state'
)
...
...
mex/sources/mjdgges/mjdgges.c
View file @
b58eaa8e
...
...
@@ -60,7 +60,15 @@ mjdgges(double *a, double *b, double *z, double *n, double *sdim, double *eval_r
pei
=
eval_i
;
for
(
per
=
eval_r
;
per
<=
&
eval_r
[
i_n
-
1
];
++
per
)
{
if
((
fabs
(
*
par
)
>
1e-6
)
||
(
fabs
(
*
pb
)
>
1e-6
))
*
per
=
*
par
/
*
pb
;
else
{
/* the ratio is too close to 0/0;
returns specific error number only if no other error */
if
(
i_info
==
0
)
*
info
=
-
30
;
}
if
(
*
pai
==
0
.
0
&&
*
pb
==
0
.
0
)
*
pei
=
0
.
0
;
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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