ident_bruteforce.m: remove globals

new-samplers
Johannes Pfeifer 2023-11-25 19:13:55 +01:00
parent 54e72a4d35
commit ffaf6c8559
2 changed files with 9 additions and 11 deletions

View File

@ -1,5 +1,5 @@
function [pars, cosnJ] = ident_bruteforce(J, max_dim_cova_group, TeX, name_tex, tittxt, tol_deriv)
% function [pars, cosnJ] = ident_bruteforce(J,n,TeX, pnames_TeX,tittxt)
function [pars, cosnJ] = ident_bruteforce(dname,fname,J, max_dim_cova_group, TeX, name_tex, tittxt, tol_deriv)
% [pars, cosnJ] = ident_bruteforce(dname,fname,J, max_dim_cova_group, TeX, name_tex, tittxt, tol_deriv)
% -------------------------------------------------------------------------
% given the Jacobian matrix J of moment derivatives w.r.t. parameters
% computes, for each column of J, the groups of columns from 1 to n that
@ -20,7 +20,7 @@ function [pars, cosnJ] = ident_bruteforce(J, max_dim_cova_group, TeX, name_tex,
% This function is called by
% * identification_analysis.m
% =========================================================================
% Copyright © 2009-2019 Dynare Team
% Copyright © 2009-2023 Dynare Team
%
% This file is part of Dynare.
%
@ -38,20 +38,18 @@ function [pars, cosnJ] = ident_bruteforce(J, max_dim_cova_group, TeX, name_tex,
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
% =========================================================================
global M_ options_
OutputDirectoryName = CheckPath('identification',M_.dname);
OutputDirectoryName = CheckPath('identification',dname);
totparam_nbr = size(J,2); % number of parameters
if nargin<2 || isempty(max_dim_cova_group)
if nargin<4 || isempty(max_dim_cova_group)
max_dim_cova_group = 4; % max n-tuple
end
if nargin<3 || isempty(TeX)
if nargin<5 || isempty(TeX)
TeX = 0; % no Tex output
tittxt='';
end
if nargin < 6
if nargin < 8
tol_deriv = 1.e-8;
end
@ -87,7 +85,7 @@ for ll = 1:max_dim_cova_group
end
dyn_waitbar_close(h);
if TeX
filename = [OutputDirectoryName '/' M_.fname '_collin_patterns_',tittxt1,'_' int2str(ll) '.tex'];
filename = [OutputDirectoryName '/' fname '_collin_patterns_',tittxt1,'_' int2str(ll) '.tex'];
fidTeX = fopen(filename,'w');
fprintf(fidTeX,'%% TeX-table generated by ident_bruteforce (Dynare).\n');
fprintf(fidTeX,['%% Collinearity patterns with ',int2str(ll),' parameter(s): ',tittxt,'\n']);

View File

@ -462,7 +462,7 @@ if info(1) == 0 %no errors in solution
if advanced
% here we do not normalize (i.e. we set norm_dMOMENTS=1) as the OLS in ident_bruteforce is very sensitive to norm_dMOMENTS
[ide_moments.pars, ide_moments.cosndMOMENTS] = ident_bruteforce(dMOMENTS(ind_dMOMENTS,:), max_dim_cova_group, options_.TeX, options_ident.name_tex, options_ident.tittxt, tol_deriv);
[ide_moments.pars, ide_moments.cosndMOMENTS] = ident_bruteforce(M_.dname,M_.fname,dMOMENTS(ind_dMOMENTS,:), max_dim_cova_group, options_.TeX, options_ident.name_tex, options_ident.tittxt, tol_deriv);
end
%here we focus on the unnormalized S and V, which is then used in plot_identification.m and for prior_mc > 1