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
MichelJuillard
dynare
Commits
27622a29
Commit
27622a29
authored
Jun 06, 2015
by
Johannes Pfeifer
Browse files
Fix initialization of parameter bounds for ML case in stab_map_.m
parent
c9b05575
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/gsa/prior_draw_gsa.m
View file @
27622a29
...
...
@@ -42,7 +42,7 @@ function pdraw = prior_draw_gsa(init,rdraw)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global
bayestopt_
options_
global
bayestopt_
options_
estim_params_
M_
persistent
npar
pshape
p6
p7
p3
p4
lbcum
ubcum
if
init
...
...
@@ -55,7 +55,18 @@ if init
pdraw
=
zeros
(
npar
,
1
);
lbcum
=
zeros
(
npar
,
1
);
ubcum
=
ones
(
npar
,
1
);
bounds
=
prior_bounds
(
bayestopt_
,
options_
);
[
junk1
,
junk2
,
junk3
,
lb
,
ub
,
junk4
]
=
set_prior
(
estim_params_
,
M_
,
options_
);
%Prepare bounds
if
~
isempty
(
bayestopt_
)
&&
any
(
bayestopt_
.
pshape
>
0
)
% Set prior bounds
bounds
=
prior_bounds
(
bayestopt_
,
options_
);
bounds
.
lb
=
max
(
bounds
.
lb
,
lb
);
bounds
.
ub
=
min
(
bounds
.
ub
,
ub
);
else
% estimated parameters but no declared priors
% No priors are declared so Dynare will estimate the model by
% maximum likelihood with inequality constraints for the parameters.
bounds
.
lb
=
lb
;
bounds
.
ub
=
ub
;
end
% set bounds for cumulative probabilities
for
i
=
1
:
npar
switch
pshape
(
i
)
...
...
@@ -63,8 +74,8 @@ if init
p4
(
i
)
=
min
(
p4
(
i
),
bounds
.
ub
(
i
));
p3
(
i
)
=
max
(
p3
(
i
),
bounds
.
lb
(
i
));
case
3
% Gaussian prior.
lbcum
(
i
)
=
0.5
*
erfc
(
-
(
bounds
.
lb
(
i
)
-
p6
(
i
))/
p7
(
i
)
.
/
sqrt
(
2
));
;
ubcum
(
i
)
=
0.5
*
erfc
(
-
(
bounds
.
ub
(
i
)
-
p6
(
i
))/
p7
(
i
)
.
/
sqrt
(
2
));
;
lbcum
(
i
)
=
0.5
*
erfc
(
-
(
bounds
.
lb
(
i
)
-
p6
(
i
))/
p7
(
i
)
.
/
sqrt
(
2
));
ubcum
(
i
)
=
0.5
*
erfc
(
-
(
bounds
.
ub
(
i
)
-
p6
(
i
))/
p7
(
i
)
.
/
sqrt
(
2
));
case
2
% Gamma prior.
lbcum
(
i
)
=
gamcdf
(
bounds
.
lb
(
i
)
-
p3
(
i
),
p6
(
i
),
p7
(
i
));
ubcum
(
i
)
=
gamcdf
(
bounds
.
ub
(
i
)
-
p3
(
i
),
p6
(
i
),
p7
(
i
));
...
...
matlab/gsa/stab_map_.m
View file @
27622a29
...
...
@@ -162,7 +162,7 @@ if fload==0,
end
end
% try
%
dummy=prior_draw_gsa(1);
dummy
=
prior_draw_gsa
(
1
);
%initialize persistent variables
% catch
% if pprior,
% if opt_gsa.prior_range==0;
...
...
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