v4.1:: Added bounds to the uniform distribution (consistently with
the other prior distributions). git-svn-id: https://www.dynare.org/svn/dynare/trunk@2423 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
01ba142329
commit
d082bc09b1
|
@ -1,12 +1,12 @@
|
||||||
function bounds = prior_bounds(bayestopt)
|
function bounds = prior_bounds(bayestopt)
|
||||||
% function bounds = prior_bounds(bayestopt)
|
% function bounds = prior_bounds(bayestopt)
|
||||||
% computes practical bounds for prior density
|
% computes bounds for prior density.
|
||||||
%
|
%
|
||||||
% INPUTS
|
% INPUTS
|
||||||
% bayestopt: structure characterizing priors (shape, mean, p1..p4)
|
% bayestopt [structure] characterizing priors (shape, mean, p1..p4)
|
||||||
%
|
%
|
||||||
% OUTPUTS
|
% OUTPUTS
|
||||||
% bounds: matrix specifying bounds (row= parameter, column=upper&lower bound)
|
% bounds [double] matrix specifying prior bounds (row= parameter, column=upper&lower bound)
|
||||||
%
|
%
|
||||||
% SPECIAL REQUIREMENTS
|
% SPECIAL REQUIREMENTS
|
||||||
% none
|
% none
|
||||||
|
@ -61,12 +61,12 @@ for i=1:n
|
||||||
bounds(i,1) = 1/sqrt(gaminv(1-options_.prior_trunc, p2(i)/2, 2/p1(i)));
|
bounds(i,1) = 1/sqrt(gaminv(1-options_.prior_trunc, p2(i)/2, 2/p1(i)));
|
||||||
bounds(i,2) = 1/sqrt(gaminv(options_.prior_trunc, p2(i)/2, 2/p1(i)));
|
bounds(i,2) = 1/sqrt(gaminv(options_.prior_trunc, p2(i)/2, 2/p1(i)));
|
||||||
case 5
|
case 5
|
||||||
bounds(i,1) = p1(i);
|
bounds(i,1) = p1(i)+(p2(i)-p1(i))*options_.prior_trunc;
|
||||||
bounds(i,2) = p2(i);
|
bounds(i,2) = p2(i)-(p2(i)-p1(i))*options_.prior_trunc;
|
||||||
case 6
|
case 6
|
||||||
bounds(i,1) = 1/gaminv(1-options_.prior_trunc, p2(i)/2, 2/p1(i));
|
bounds(i,1) = 1/gaminv(1-options_.prior_trunc, p2(i)/2, 2/p1(i));
|
||||||
bounds(i,2) = 1/gaminv(options_.prior_trunc, p2(i)/2, 2/p1(i));
|
bounds(i,2) = 1/gaminv(options_.prior_trunc, p2(i)/2, 2/p1(i));
|
||||||
otherwise
|
otherwise
|
||||||
error(sprintf('prior_bounds: unknown distribution shape (index %d, type %d)', i, pshape(i)));
|
error(sprintf('prior_bounds: unknown distribution shape (index %d, type %d)', i, pshape(i)));
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue