+ Removed globals from get_the_name routine. Added texinfo header.
parent
9b3ca2b663
commit
e2d98b9f32
|
@ -138,7 +138,7 @@ for i = 1:pages
|
|||
boxplot = 1;
|
||||
for j = 1:3 % Loop over parameters
|
||||
k = k+1;
|
||||
[nam,namtex] = get_the_name(k,TeX);
|
||||
[nam,namtex] = get_the_name(k,TeX,M_,estim_params_,options_);
|
||||
for crit = 1:3% Loop over criteria
|
||||
if crit == 1
|
||||
plt1 = UDIAG(:,1,k);
|
||||
|
@ -213,7 +213,7 @@ if reste
|
|||
boxplot = 1;
|
||||
for j = 1:reste
|
||||
k = k+1;
|
||||
[nam,namtex] = get_the_name(k,TeX);
|
||||
[nam,namtex] = get_the_name(k,TeX,M_,estim_params_,options_);
|
||||
for crit = 1:3
|
||||
if crit == 1
|
||||
plt1 = UDIAG(:,1,k);
|
||||
|
|
|
@ -69,7 +69,7 @@ for i=1:npar
|
|||
hfig = figure('Name',figurename);
|
||||
end
|
||||
end
|
||||
[nam,texnam] = get_the_name(i,TeX);
|
||||
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
|
||||
if subplotnum == 1
|
||||
NAMES = nam;
|
||||
if TeX
|
||||
|
|
|
@ -66,7 +66,7 @@ if size(M_.param_names,1)==size(M_.param_names_tex,1)% All the parameters have a
|
|||
PriorIntervals = prior_bounds(bayestopt_) ;
|
||||
options_.prior_trunc = prior_trunc_backup ;
|
||||
for i=1:size(bayestopt_.name,1)
|
||||
[tmp,TexName] = get_the_name(i,1);
|
||||
[tmp,TexName] = get_the_name(i,1,M_,estim_params_,options_);
|
||||
PriorShape = PriorNames{ bayestopt_.pshape(i) };
|
||||
PriorMean = bayestopt_.p1(i);
|
||||
PriorStandardDeviation = bayestopt_.p2(i);
|
||||
|
@ -157,7 +157,7 @@ if info==2% Prior optimization.
|
|||
disp('------------------')
|
||||
disp(' ')
|
||||
for i = 1:length(xparams)
|
||||
disp(['deep parameter ' int2str(i) ': ' get_the_name(i,0) '.'])
|
||||
disp(['deep parameter ' int2str(i) ': ' get_the_name(i,0,M_,estim_params_,options_) '.'])
|
||||
disp([' Initial condition ....... ' num2str(xinit(i)) '.'])
|
||||
disp([' Prior mode .............. ' num2str(bayestopt_.p5(i)) '.'])
|
||||
disp([' Optimized prior mode .... ' num2str(xparams(i)) '.'])
|
||||
|
|
|
@ -1,21 +1,46 @@
|
|||
function [nam,texnam] = get_the_name(k,TeX)
|
||||
function [nam,texnam] = get_the_name(k,TeX,M_,estim_params_,options_)
|
||||
|
||||
% function [nam,texnam] = get_the_name(k,TeX)
|
||||
% get the name of parameters
|
||||
%
|
||||
% INPUTS
|
||||
% k: parameter number
|
||||
% Tex=1: tex variable name
|
||||
% Tex=0: variable name (in the mod-file)
|
||||
%
|
||||
% OUTPUTS
|
||||
% nam: variable name
|
||||
% texnam: variable tex name
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
%@info:
|
||||
%! @deftypefn {Function File} {[@var{nam},@var{texnam}] =} get_the_name (@var{k},@var{TeX},@var{M_},@var{estim_params_},@var{options_})
|
||||
%! @anchor{get_the_name}
|
||||
%! @sp 1
|
||||
%! Returns the name of the estimated parameter number @var{k}, following the internal ordering of the estimated parameters.
|
||||
%! @sp 2
|
||||
%! @strong{Inputs}
|
||||
%! @sp 1
|
||||
%! @table @ @var
|
||||
%! @item k
|
||||
%! Integer scalar, parameter number.
|
||||
%! @item TeX
|
||||
%! Integer scalar, if @var{TeX}==0 then @var{texnam} is not returned (empty matrix).
|
||||
%! @item M_
|
||||
%! Matlab's structure describing the model (initialized by @code{dynare}).
|
||||
%! @item estim_params_
|
||||
%! Matlab's structure describing the estimated parameters (initialized by @code{dynare}).
|
||||
%! @item options_
|
||||
%! Matlab's structure describing the options (initialized by @code{dynare}).
|
||||
%! @end table
|
||||
%! @sp 2
|
||||
%! @strong{Outputs}
|
||||
%! @sp 1
|
||||
%! @table @ @var
|
||||
%! @item nam
|
||||
%! String, internal name of the variable
|
||||
%! @item texnam
|
||||
%! String, TeX name of the same variable (if defined in the mod file).
|
||||
%! @end table
|
||||
%! @sp 2
|
||||
%! @strong{This function is called by:}
|
||||
%! @sp 1
|
||||
%! @ref{get_prior_info}, @ref{McMCDiagnostics}, @ref{mode_check}, @ref{PlotPosteriorDistributions}, @ref{plot_priors}
|
||||
%! @sp 2
|
||||
%! @strong{This function calls:}
|
||||
%! @sp 1
|
||||
%! None.
|
||||
%! @end deftypefn
|
||||
%@eod:
|
||||
|
||||
% Copyright (C) 2004-2010 Dynare Team
|
||||
% Copyright (C) 2004-2011 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -32,8 +57,6 @@ function [nam,texnam] = get_the_name(k,TeX)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
global M_ estim_params_ options_
|
||||
|
||||
nam = [];
|
||||
texnam = [];
|
||||
|
||||
|
@ -84,8 +107,3 @@ else
|
|||
texnam = ['$ ' deblank(M_.param_names_tex(jj1,:)) ' $'];
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
% SA 07-15-2004 Added TeX names.
|
||||
% SA 12-02-2004 Changed non-TeX names format.
|
||||
% SA 01-11-2005 v3TOv4
|
|
@ -35,7 +35,7 @@ function mode_check(x,fval,hessian,gend,data,lb,ub,data_index,number_of_observat
|
|||
% 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_ M_ options_
|
||||
global bayestopt_ M_ options_ estim_params_
|
||||
|
||||
TeX = options_.TeX;
|
||||
if ~isempty(hessian);
|
||||
|
@ -77,7 +77,7 @@ for plt = 1:nbplt,
|
|||
for k=1:min(nstar,length(x)-(plt-1)*nstar)
|
||||
subplot(nr,nc,k)
|
||||
kk = (plt-1)*nstar+k;
|
||||
[name,texname] = get_the_name(kk,TeX);
|
||||
[name,texname] = get_the_name(kk,TeX,M_,estim_params_,options_);
|
||||
if TeX
|
||||
if isempty(NAMES)
|
||||
NAMES = name;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function plot_priors(bayestopt_,M_,options_)
|
||||
function plot_priors(bayestopt_,M_,estim_params_,options_)
|
||||
% function plot_priors
|
||||
% plots prior density
|
||||
%
|
||||
|
@ -50,7 +50,7 @@ if nbplt == 1
|
|||
end
|
||||
for i=1:npar
|
||||
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);
|
||||
[nam,texnam] = get_the_name(i,TeX);
|
||||
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
|
||||
if TeX
|
||||
if i==1
|
||||
TeXNAMES = texnam;
|
||||
|
@ -97,7 +97,7 @@ else
|
|||
for index=1:nstar
|
||||
names = [];
|
||||
i = (plt-1)*nstar + index;
|
||||
[nam,texnam] = get_the_name(i,TeX);
|
||||
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
|
||||
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);
|
||||
if TeX
|
||||
if index==1
|
||||
|
@ -142,7 +142,7 @@ else
|
|||
for index=1:npar-(nbplt-1)*nstar
|
||||
i = (nbplt-1)*nstar + index;
|
||||
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);
|
||||
[nam,texnam] = get_the_name(i,TeX);
|
||||
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
|
||||
if TeX
|
||||
if index==1
|
||||
TeXNAMES = texnam;
|
||||
|
@ -184,5 +184,3 @@ else
|
|||
fclose(fidTeX);
|
||||
end
|
||||
end
|
||||
|
||||
% SA 01-11-2005 v3TOv4
|
||||
|
|
Loading…
Reference in New Issue