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
Dóra Kocsis
dynare
Commits
8de93c21
Commit
8de93c21
authored
Mar 04, 2012
by
Stéphane Adjemian
Browse files
Fixed bug (cost_flag->exit_flag).
parent
724b9941
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/non_linear_dsge_likelihood.m
View file @
8de93c21
...
...
@@ -141,7 +141,7 @@ end
fval
=
[];
ys
=
[];
trend_coeff
=
[];
cos
t_flag
=
1
;
exi
t_flag
=
1
;
%
Set
the
number
of
observed
variables
nvobs
=
DynareDataset
.
info
.
nvobs
;
...
...
@@ -154,7 +154,7 @@ nvobs = DynareDataset.info.nvobs;
if
(
DynareOptions
.
mode_compute
~=
1
)
&
any
(
xparam1
<
BayesInfo
.
lb
)
k
=
find
(
xparam1
<
BayesInfo
.
lb
);
fval
=
penalty
+
sum
((
BayesInfo
.
lb
(
k
)
-
xparam1
(
k
)).
^
2
);
cos
t_flag
=
0
;
exi
t_flag
=
0
;
info
=
41
;
return
end
...
...
@@ -163,7 +163,7 @@ end
if
(
DynareOptions
.
mode_compute
~=
1
)
&
any
(
xparam1
>
BayesInfo
.
ub
)
k
=
find
(
xparam1
>
BayesInfo
.
ub
);
fval
=
penalty
+
sum
((
xparam1
(
k
)
-
BayesInfo
.
ub
(
k
)).
^
2
);
cos
t_flag
=
0
;
exi
t_flag
=
0
;
info
=
42
;
return
end
...
...
@@ -202,7 +202,7 @@ if EstimatedParameters.ncx
k
=
find
(
a
<
0
);
if
k
>
0
fval
=
penalty
+
sum
(
-
a
(
k
));
cos
t_flag
=
0
;
exi
t_flag
=
0
;
info
=
43
;
return
end
...
...
@@ -226,7 +226,7 @@ if EstimatedParameters.ncn
k
=
find
(
a
<
0
);
if
k
>
0
fval
=
penalty
+
sum
(
-
a
(
k
));
cos
t_flag
=
0
;
exi
t_flag
=
0
;
info
=
44
;
return
end
...
...
@@ -252,11 +252,11 @@ Model.H = H;
if
info
(
1
)
==
1
||
info
(
1
)
==
2
||
info
(
1
)
==
5
fval
=
penalty
+
1
;
cos
t_flag
=
0
;
exi
t_flag
=
0
;
return
elseif
info
(
1
)
==
3
||
info
(
1
)
==
4
||
info
(
1
)
==
6
||
info
(
1
)
==
19
||
info
(
1
)
==
20
||
info
(
1
)
==
21
fval
=
penalty
+
info
(
2
);
cos
t_flag
=
0
;
exi
t_flag
=
0
;
return
end
...
...
@@ -358,10 +358,10 @@ DynareOptions.warning_for_steadystate = 0;
LIK
=
feval
(
DynareOptions
.
particle
.
algorithm
,
ReducedForm
,
Y
,[],
DynareOptions
);
if
imag
(
LIK
)
likelihood
=
penalty
;
cos
t_flag
=
0
;
exi
t_flag
=
0
;
elseif
isnan
(
LIK
)
likelihood
=
penalty
;
cos
t_flag
=
0
;
exi
t_flag
=
0
;
else
likelihood
=
LIK
;
end
...
...
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