Compare commits
18 Commits
4a6783c690
...
0ce32f3367
Author | SHA1 | Date |
---|---|---|
Stéphane Adjemian (Guts) | 0ce32f3367 | |
Stéphane Adjemian (Guts) | 23af7f64b6 | |
Stéphane Adjemian (Guts) | 0249ea2116 | |
Stéphane Adjemian (Guts) | 44119077db | |
Stéphane Adjemian (Guts) | 47af0cde16 | |
Sébastien Villemot | eb043406e6 | |
Sébastien Villemot | ae082cffbe | |
Sébastien Villemot | febd39713e | |
Sébastien Villemot | 20b2c79ffb | |
Sébastien Villemot | 458926b17b | |
Sébastien Villemot | 162ca815bc | |
Sébastien Villemot | ff7cc9267e | |
Sébastien Villemot | 56e97e29aa | |
Sébastien Villemot | adddcf6197 | |
Sébastien Villemot | 79959aa587 | |
Sébastien Villemot | a0bafbcb95 | |
Sébastien Villemot | 2005f292e5 | |
Johannes Pfeifer | 3e7291b573 |
|
@ -151,7 +151,7 @@ Comment: The original author gave authorization to change
|
|||
|
||||
Files: matlab/+pruned_SS/prodmom.m matlab/+pruned_SS/bivmom.m
|
||||
Copyright: 2008-2015 Raymond Kan <kan@chass.utoronto.ca>
|
||||
2019-2020 Dynare Team
|
||||
2019-2023 Dynare Team
|
||||
License: GPL-3+
|
||||
Comment: The author gave authorization to redistribute
|
||||
these functions under GPL-3+ with Dynare and would
|
||||
|
@ -242,7 +242,7 @@ License: BSD-2-clause
|
|||
|
||||
Files: matlab/utilities/graphics/colorspace.m
|
||||
Copyright: 2005-2010 Pascal Getreuer
|
||||
2017 Dynare Team
|
||||
2017-2023 Dynare Team
|
||||
License: BSD-2-clause
|
||||
|
||||
Files: examples/fs2000_data.m
|
||||
|
|
|
@ -154,8 +154,8 @@ end
|
|||
% Store results
|
||||
|
||||
DirectoryName = [ M_.dname '/bvar_forecast' ];
|
||||
if ~isdir(DirectoryName)
|
||||
if ~isdir(M_.dname)
|
||||
if ~isfolder(DirectoryName)
|
||||
if ~isfolder(M_.dname)
|
||||
mkdir(M_.dname);
|
||||
end
|
||||
mkdir(DirectoryName);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function dyn_graph=dynare_graph_init(figure_name,nplot,line_types,line_width)
|
||||
% function dynare_graph_init(figure_name,colors)
|
||||
function dyn_graph=graph_init(figure_name,nplot,line_types,line_width)
|
||||
% function graph_init(figure_name,colors)
|
||||
% initializes set of graphs
|
||||
%
|
||||
% INPUTS:
|
||||
|
@ -12,7 +12,7 @@ function dyn_graph=dynare_graph_init(figure_name,nplot,line_types,line_width)
|
|||
% SPECIAL REQUIREMENT
|
||||
% none
|
||||
|
||||
% Copyright © 2006-2017 Dynare Team
|
||||
% Copyright © 2006-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
|
|
@ -130,7 +130,7 @@ end
|
|||
|
||||
% Save intermediate results
|
||||
DirectoryName = [ M_.dname '/bvar_irf' ];
|
||||
if ~isdir(DirectoryName)
|
||||
if ~isfolder(DirectoryName)
|
||||
mkdir('.',DirectoryName);
|
||||
end
|
||||
save([ DirectoryName '/simulations.mat'], 'sampled_irfs');
|
||||
|
@ -146,4 +146,4 @@ for i=1:ny
|
|||
oo_.bvar.irf.Upper_bound.(variable_name).(shock_name) = posterior_up_conf_irfs(j,i,:);
|
||||
oo_.bvar.irf.Lower_bound.(variable_name).(shock_name) = posterior_down_conf_irfs(j,i,:);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function [ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags)
|
||||
%function [ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags)
|
||||
function [ny, nx, posterior, prior, forecast_data] = toolbox(nlags)
|
||||
%function [ny, nx, posterior, prior, forecast_data] = toolbox(nlags)
|
||||
% bvar_toolbox Routines shared between BVAR methods
|
||||
% Computes several things for the estimations of a BVAR(nlags)
|
||||
%
|
||||
|
@ -42,7 +42,7 @@ function [ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags)
|
|||
% - bvar_prior_{tau,decay,lambda,mu,omega,flat,train}
|
||||
|
||||
% Copyright © 2003-2007 Christopher Sims
|
||||
% Copyright © 2007-2017 Dynare Team
|
||||
% Copyright © 2007-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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)
|
||||
function [pars, cosnJ] = bruteforce(dname,fname,J, max_dim_cova_group, TeX, name_tex, tittxt, tol_deriv)
|
||||
% [pars, cosnJ] = 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
|
||||
|
|
|
@ -78,14 +78,14 @@ end
|
|||
Counter(0);
|
||||
|
||||
switch L1ops
|
||||
case {'==' '='},
|
||||
case {'==' '='}
|
||||
if isnan(MaxCounter)
|
||||
% return the number of solutions
|
||||
v = nchoosek(n+L1-1,L1); % nchoosek(n+L1-1,n-1)
|
||||
else
|
||||
v = allVL1eq(n, L1);
|
||||
end
|
||||
case '<=', % call allVL1eq for various sum targets
|
||||
case '<=' % call allVL1eq for various sum targets
|
||||
if isnan(MaxCounter)
|
||||
% return the number of solutions
|
||||
%v = nchoosek(n+L1,L1)*factorial(n-L1); BUG <- 16/Sep/2009:
|
||||
|
@ -99,7 +99,7 @@ switch L1ops
|
|||
v = cell2mat(arrayfun(@(j) allVL1eq(n, j), (0:L1)', ...
|
||||
'UniformOutput', false));
|
||||
end
|
||||
case '<',
|
||||
case '<'
|
||||
v = allVL1(n, L1-1, '<=', MaxCounter);
|
||||
otherwise
|
||||
error('allVL1: unknown L1ops')
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
% Multivariate Analysis, 2008, vol. 99, issue 3, pages 542-554.
|
||||
% =========================================================================
|
||||
% Copyright © 2008-2015 Raymond Kan <kan@chass.utoronto.ca>
|
||||
% Copyright © 2019-2020 Dynare Team
|
||||
% Copyright © 2019-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -38,7 +38,7 @@
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
% =========================================================================
|
||||
function y = prodmom(V,ii,nu);
|
||||
function y = prodmom(V,ii,nu)
|
||||
if nargin<3
|
||||
nu = ones(size(ii));
|
||||
end
|
||||
|
@ -104,4 +104,4 @@ for i=1:fix(prod(nu+1)/2)
|
|||
end
|
||||
end
|
||||
end
|
||||
y = y/prod([1:s2]);
|
||||
y = y/prod([1:s2]);
|
||||
|
|
|
@ -33,7 +33,7 @@ info = 0;
|
|||
|
||||
DirectoryName = [ dname '/' type ]; % don't use filesep as it will create issues with LaTeX on Windows
|
||||
|
||||
if ~isdir(dname)
|
||||
if ~isfolder(dname)
|
||||
% Make sure there isn't a file with the same name, see trac ticket #47
|
||||
if isfile(dname)
|
||||
delete(dname)
|
||||
|
@ -41,7 +41,7 @@ if ~isdir(dname)
|
|||
mkdir('.', dname);
|
||||
end
|
||||
|
||||
if ~isdir(DirectoryName)
|
||||
if ~isfolder(DirectoryName)
|
||||
% Make sure there isn't a file with the same name, see trac ticket #47
|
||||
if isfile(DirectoryName)
|
||||
delete(DirectoryName)
|
||||
|
|
|
@ -56,7 +56,8 @@ elseif NumberOfPlots == 1
|
|||
end
|
||||
|
||||
for plt = 1:NumberOfPlots
|
||||
eval(['NumberOfCurves = Info.Box' int2str(plt) '.Number;'])
|
||||
field1 = sprintf('Box%u', plt);
|
||||
NumberOfCurves = Info.(field1).Number;
|
||||
NumberOfObservations = zeros(2,1);
|
||||
x = cell(NumberOfCurves,1);
|
||||
y = cell(NumberOfCurves,1);
|
||||
|
@ -66,10 +67,11 @@ for plt = 1:NumberOfPlots
|
|||
binf = NaN(NumberOfCurves,1);
|
||||
bsup = NaN(NumberOfCurves,1);
|
||||
for curve = 1:NumberOfCurves
|
||||
eval(['x{' curve '} = Info.Box' int2str(plt) '.Curve' int2str(curve) '.xdata;'])
|
||||
eval(['y{' curve '} = Info.Box' int2str(plt) '.Curve' int2str(curve) '.ydata;'])
|
||||
eval(['name = Info.Box' int2str(plt) '.Curve' int2str(curve) '.variablename;'])
|
||||
eval(['PltType{' curve '} = Info.Box' int2str(plt) '.Curve' int2str(curve) '.type']);
|
||||
field2 = sprintf('Curve%u', curve);
|
||||
x{curve} = Info.(field1).(field2).xdata;
|
||||
y{curve} = Info.(field1).(field2).ydata;
|
||||
name = Info.(field1).(field2).variablename;
|
||||
PltType{curve} = Info.(field1).(field2).type;
|
||||
if length(x{curve})-length(y{curve})
|
||||
disp('MakeFigure :: The number of observations in x doesn''t match with ')
|
||||
disp(['the number of observation in y for ' name ])
|
||||
|
@ -90,9 +92,9 @@ for plt = 1:NumberOfPlots
|
|||
if isnan(ymin(plt))
|
||||
ymin = 0;
|
||||
end
|
||||
eval(['NAMES{' int2str(plt) '} = Info.Box' int2str(plt) '.name;'])
|
||||
NAMES{plt} = Info.(field1).name;
|
||||
if options_.TeX
|
||||
eval(['TeXNAMES{' int2str(plt) '} = Info.Box' int2str(plt) '.texname;'])
|
||||
TeXNAMES{plt} = Info.(field1).texname;
|
||||
end
|
||||
subplot(nr,nc,plt)
|
||||
hold on
|
||||
|
@ -148,22 +150,24 @@ end
|
|||
|
||||
if Info.SaveFormat.Eps
|
||||
if isempty(Info.SaveFormat.Name)
|
||||
eval(['print -depsc2 ' M_.fname Info.SaveFormat.GenericName int2str(Info.SaveFormat.Number) '.eps']);
|
||||
print(sprintf('%s%s%u', M_.fname, Info.SaveFormat.GenericName, Info.SaveFormat.Number), '-depsc2')
|
||||
else
|
||||
eval(['print -depsc2 ' M_.fname Info.SaveFormat.GenericName Info.SaveFormat.Name '.eps']);
|
||||
print(sprintf('%s%s%s', M_.fname, Info.SaveFormat.GenericName, Info.SaveFormat.Name), '-depsc2')
|
||||
end
|
||||
end
|
||||
|
||||
if Info.SaveFormat.Pdf && ~isoctave
|
||||
if isempty(Info.SaveFormat.Name)
|
||||
eval(['print -dpdf ' M_.fname Info.SaveFormat.GenericName int2str(Info.SaveFormat.Number)]);
|
||||
print(sprintf('%s%s%u', M_.fname, Info.SaveFormat.GenericName, Info.SaveFormat.Number), '-dpdf')
|
||||
else
|
||||
eval(['print -dpdf ' M_.fname Info.SaveFormat.GenericName Info.SaveFormat.Name]);
|
||||
print(sprintf('%s%s%s', M_.fname, Info.SaveFormat.GenericName, Info.SaveFormat.Name), '-dpdf')
|
||||
end
|
||||
end
|
||||
|
||||
if Info.SaveFormat.Fig && ~isoctave
|
||||
if isempty(Info.SaveFormat.Name)
|
||||
saveas(FigHandle,[M_.fname Info.SaveFormat.GenericName int2str(Info.SaveFormat.Number) '.fig']);
|
||||
saveas(FigHandle, sprintf('%s%s%u.fig', M_.fname, Info.SaveFormat.GenericName, Info.SaveFormat.Number));
|
||||
else
|
||||
saveas(FigHandle,[M_.fname Info.SaveFormat.GenericName Info.SaveFormat.Name '.fig']);
|
||||
saveas(FigHandle, sprintf('%s%s%s.fig', M_.fname, Info.SaveFormat.GenericName, Info.SaveFormat.Name));
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ global M_
|
|||
i = strmatch(pname,M_.param_names,'exact');
|
||||
|
||||
if isempty(i)
|
||||
error(sprintf('Can''t find parameter %s', pname))
|
||||
error('Can''t find parameter %s', pname)
|
||||
end
|
||||
|
||||
x = M_.params(i);
|
||||
|
|
|
@ -41,7 +41,7 @@ if options_.dsge_var && options_.bayesian_irf
|
|||
for i=1:size(varlist,1)
|
||||
idx = strmatch(varlist{i}, options_.varobs, 'exact');
|
||||
if isempty(idx)
|
||||
disp(sprintf('%s is not an observed variable!', varlist{i}))
|
||||
dprintf('%s is not an observed variable!', varlist{i})
|
||||
msg = true;
|
||||
end
|
||||
end
|
||||
|
@ -169,4 +169,4 @@ while ~isempty(remain)
|
|||
end
|
||||
if index<max_number_of_words_per_line
|
||||
disp(line_of_text)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -103,6 +103,6 @@ for taper_index=1:length(taper_steps)
|
|||
results_vec(1,4+taper_index*2-1)=NSE_taper;
|
||||
results_vec(1,4+taper_index*2)=total_variance/(n_draws_used*NSE_taper^2);
|
||||
|
||||
eval(['results_struct.nse_taper_',num2str(taper),'= NSE_taper;']);
|
||||
eval(['results_struct.rne_taper_',num2str(taper),'= total_variance/(n_draws_used*NSE_taper^2);']);
|
||||
results_struct.(sprintf('nse_taper_%u', taper)) = NSE_taper;
|
||||
results_struct.(sprintf('rne_taper_%u', taper)) = total_variance/(n_draws_used*NSE_taper^2);
|
||||
end % end of for mm loop
|
||||
|
|
|
@ -48,7 +48,7 @@ function [H,G,retcode]=discretionary_policy_engine(AAlag,AA0,AAlead,BB,bigw,inst
|
|||
% Dennis, Richard (2007): Optimal policy in rational expectations models: new solution algorithms,
|
||||
% Macroeconomic Dynamics, 11, 3155.
|
||||
|
||||
% Copyright © 2007-2018 Dynare Team
|
||||
% Copyright © 2007-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -189,7 +189,7 @@ function [rcode,NQ]=CheckConvergence(Q,iter,MaxIter,crit)
|
|||
NQ=max(max(abs(Q)));% norm(Q); seems too costly
|
||||
if isnan(NQ)
|
||||
rcode=3;
|
||||
elseif iter>MaxIter;
|
||||
elseif iter>MaxIter
|
||||
rcode=2;
|
||||
elseif NQ<crit
|
||||
rcode=1;
|
||||
|
|
|
@ -94,7 +94,7 @@ try
|
|||
for i=1:n_shapes
|
||||
for j=1:n_scales
|
||||
if debug
|
||||
disp(sprintf('... mu=%s and s2=%s', num2str(mu(j,i)),num2str(s2(j,i))))
|
||||
dprintf('... mu=%s and s2=%s', num2str(mu(j,i)),num2str(s2(j,i)))
|
||||
end
|
||||
if ~isnan(mu(j,i)) && ~isnan(s2(j,i)) && ~isinf(mu(j,i)) && ~isinf(s2(j,i))
|
||||
[shape, scale] = weibull_specification(mu(j,i), s2(j,i));
|
||||
|
|
|
@ -47,7 +47,6 @@ p = {'/../contrib/ms-sbvar/TZcode/MatlabFiles/' ; ...
|
|||
'/AIM/' ; ...
|
||||
'/backward/' ; ...
|
||||
'/cli/' ; ...
|
||||
'/conditional_forecasts/'; ...
|
||||
'/convergence_diagnostics/' ; ...
|
||||
'/discretionary_policy/' ; ...
|
||||
'/distributions/' ; ...
|
||||
|
@ -55,7 +54,6 @@ p = {'/../contrib/ms-sbvar/TZcode/MatlabFiles/' ; ...
|
|||
'/estimation/'; ...
|
||||
'/estimation/smc/'; ...
|
||||
'/estimation/resampler/'; ...
|
||||
'/gsa/' ; ...
|
||||
'/kalman/' ; ...
|
||||
'/kalman/likelihood' ; ...
|
||||
'/latex/' ; ...
|
||||
|
|
|
@ -54,7 +54,7 @@ if ismember(method, [1, 2])
|
|||
flag = ~flag;
|
||||
end
|
||||
if debug
|
||||
disp(sprintf('%s\t %1.8f\t %s',int2str(iteration),weight,int2str(flag)))
|
||||
dprintf('%u\t %1.8f\t %u', iteration, weight, flag)
|
||||
end
|
||||
state(2:end) = state(1:end-1);
|
||||
state(1) = flag;
|
||||
|
@ -121,7 +121,7 @@ if isequal(method, 3) || (isequal(method, 2) && noconvergence)
|
|||
flag = ~flag;
|
||||
end
|
||||
if debug
|
||||
disp(sprintf('%s\t %1.8f\t %s',int2str(index),weight,int2str(flag)))
|
||||
dprintf('%u\t %1.8f\t %u', index, weight, flag)
|
||||
end
|
||||
if flag
|
||||
jndex = index;
|
||||
|
|
|
@ -119,11 +119,11 @@ if np
|
|||
oo_ = Filloo(oo_, name, type, post_mean, hpd_interval, post_median, post_var, post_deciles, density);
|
||||
end
|
||||
end
|
||||
disp(sprintf(pformat, header_width, name, bayestopt_.p1(ip),...
|
||||
post_mean, ...
|
||||
hpd_interval, ...
|
||||
pnames{bayestopt_.pshape(ip)+1}, ...
|
||||
bayestopt_.p2(ip)));
|
||||
dprintf(pformat, header_width, name, bayestopt_.p1(ip),...
|
||||
post_mean, ...
|
||||
hpd_interval, ...
|
||||
pnames{bayestopt_.pshape(ip)+1}, ...
|
||||
bayestopt_.p2(ip));
|
||||
if TeX
|
||||
k = estim_params_.param_vals(i,1);
|
||||
name = M_.param_names_tex{k};
|
||||
|
@ -167,7 +167,7 @@ if nvx
|
|||
M_.Sigma_e(k,k) = post_mean*post_mean;
|
||||
end
|
||||
end
|
||||
disp(sprintf(pformat,header_width,name, bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip)));
|
||||
dprintf(pformat, header_width, name, bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip));
|
||||
if TeX
|
||||
name = M_.exo_names_tex{k};
|
||||
TeXCore(fid,name, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p1(ip), bayestopt_.p2(ip), post_mean, sqrt(post_var), hpd_interval);
|
||||
|
@ -205,7 +205,7 @@ if nvn
|
|||
oo_ = Filloo(oo_,name,type,post_mean,hpd_interval,post_median,post_var,post_deciles,density);
|
||||
end
|
||||
end
|
||||
disp(sprintf(pformat, header_width, name,bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip)));
|
||||
dprintf(pformat, header_width, name,bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip));
|
||||
if TeX
|
||||
k = estim_params_.var_endo(i,1);
|
||||
name = M_.endo_names_tex{k};
|
||||
|
@ -257,7 +257,7 @@ if ncx
|
|||
M_.Sigma_e(k2,k1) = M_.Sigma_e(k1,k2);
|
||||
end
|
||||
end
|
||||
disp(sprintf(pformat, header_width,name, bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip)));
|
||||
dprintf(pformat, header_width,name, bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip));
|
||||
if TeX
|
||||
name = sprintf('(%s,%s)', M_.exo_names_tex{k1}, M_.exo_names_tex{k2});
|
||||
TeXCore(fid, name, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p1(ip), bayestopt_.p2(ip), post_mean, sqrt(post_var), hpd_interval);
|
||||
|
@ -304,7 +304,7 @@ if ncn
|
|||
oo_ = Filloo(oo_, NAME, type, post_mean, hpd_interval, post_median, post_var, post_deciles, density);
|
||||
end
|
||||
end
|
||||
disp(sprintf(pformat, header_width, name, bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip)));
|
||||
dprintf(pformat, header_width, name, bayestopt_.p1(ip), post_mean, hpd_interval, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p2(ip));
|
||||
if TeX
|
||||
name = sprintf('(%s,%s)', M_.endo_names_tex{k1}, M_.endo_names_tex{k2});
|
||||
TeXCore(fid, name, pnames{bayestopt_.pshape(ip)+1}, bayestopt_.p1(ip), bayestopt_.p2(ip), post_mean, sqrt(post_var), hpd_interval);
|
||||
|
|
|
@ -72,8 +72,8 @@ if np
|
|||
fprintf('%-*s %10.4f %7.4f %7.4f \n', ...
|
||||
header_width, name, xparam1(ip), stdh(ip), tstath(ip));
|
||||
end
|
||||
eval(['oo_.' field_name '_mode.parameters.' name ' = xparam1(ip);']);
|
||||
eval(['oo_.' field_name '_std_at_mode.parameters.' name ' = stdh(ip);']);
|
||||
oo_.(sprintf('%s_mode', field_name)).parameters.(name) = xparam1(ip);
|
||||
oo_.(sprintf('%s_std_at_mode', field_name)).parameters.(name) = stdh(ip);
|
||||
ip = ip+1;
|
||||
end
|
||||
skipline()
|
||||
|
@ -94,8 +94,8 @@ if nvx
|
|||
fprintf('%-*s %10.4f %7.4f %7.4f \n', header_width, name, xparam1(ip), stdh(ip), tstath(ip));
|
||||
end
|
||||
M_.Sigma_e(k,k) = xparam1(ip)*xparam1(ip);
|
||||
eval(['oo_.' field_name '_mode.shocks_std.' name ' = xparam1(ip);']);
|
||||
eval(['oo_.' field_name '_std_at_mode.shocks_std.' name ' = stdh(ip);']);
|
||||
oo_.(sprintf('%s_mode', field_name)).shocks_std.(name) = xparam1(ip);
|
||||
oo_.(sprintf('%s_std_at_mode', field_name)).shocks_std.(name) = stdh(ip);
|
||||
ip = ip+1;
|
||||
end
|
||||
skipline()
|
||||
|
@ -116,8 +116,8 @@ if nvn
|
|||
fprintf('%-*s %10.4f %7.4f %7.4f \n', header_width, name, xparam1(ip), ...
|
||||
stdh(ip), tstath(ip))
|
||||
end
|
||||
eval(['oo_.' field_name '_mode.measurement_errors_std.' name ' = xparam1(ip);']);
|
||||
eval(['oo_.' field_name '_std_at_mode.measurement_errors_std.' name ' = stdh(ip);']);
|
||||
oo_.(sprintf('%s_mode', field_name)).measurement_errors_std.(name) = xparam1(ip);
|
||||
oo_.(sprintf('%s_std_at_mode', field_name)).measurement_errors_std.(name) = stdh(ip);
|
||||
ip = ip+1;
|
||||
end
|
||||
skipline()
|
||||
|
@ -142,8 +142,8 @@ if ncx
|
|||
end
|
||||
M_.Sigma_e(k1,k2) = xparam1(ip)*sqrt(M_.Sigma_e(k1,k1)*M_.Sigma_e(k2,k2));
|
||||
M_.Sigma_e(k2,k1) = M_.Sigma_e(k1,k2);
|
||||
eval(['oo_.' field_name '_mode.shocks_corr.' NAME ' = xparam1(ip);']);
|
||||
eval(['oo_.' field_name '_std_at_mode.shocks_corr.' NAME ' = stdh(ip);']);
|
||||
oo_.(sprintf('%s_mode', field_name)).shocks_corr.(NAME) = xparam1(ip);
|
||||
oo_.(sprintf('%s_std_at_mode', field_name)).shocks_corr.(NAME) = stdh(ip);
|
||||
ip = ip+1;
|
||||
end
|
||||
skipline()
|
||||
|
@ -166,8 +166,8 @@ if ncn
|
|||
fprintf('%-*s %10.4f %7.4f %7.4f \n',header_width, name, xparam1(ip), ...
|
||||
stdh(ip), tstath(ip));
|
||||
end
|
||||
eval(['oo_.' field_name '_mode.measurement_errors_corr.' NAME ' = xparam1(ip);']);
|
||||
eval(['oo_.' field_name '_std_at_mode.measurement_errors_corr.' NAME ' = stdh(ip);']);
|
||||
oo_.(sprintf('%s_mode', field_name)).measurement_errors_corr.(NAME) = xparam1(ip);
|
||||
oo_.(sprintf('%s_std_at_mode', field_name)).measurement_errors_corr.(NAME) = stdh(ip);
|
||||
ip = ip+1;
|
||||
end
|
||||
skipline()
|
||||
|
@ -407,4 +407,4 @@ function TeXEnd(fid)
|
|||
fprintf(fid,'\\end{longtable}\n ');
|
||||
fprintf(fid,'\\end{center}\n');
|
||||
fprintf(fid,'%% End of TeX file.\n');
|
||||
fclose(fid);
|
||||
fclose(fid);
|
||||
|
|
|
@ -80,7 +80,7 @@ switch pshape(indx)
|
|||
abscissa = linspace(infbound,supbound,steps);
|
||||
dens = density(abscissa,p6(indx),p7(indx),p3(indx));
|
||||
otherwise
|
||||
error(sprintf('draw_prior_density: unknown distribution shape (index %d, type %d)', indx, pshape(indx)));
|
||||
error('draw_prior_density: unknown distribution shape (index %d, type %d)', indx, pshape(indx));
|
||||
end
|
||||
|
||||
if pshape(indx) ~= 5
|
||||
|
@ -88,9 +88,9 @@ if pshape(indx) ~= 5
|
|||
if k1 == 1 || k1 == length(dens)
|
||||
k = find(dens > 10);
|
||||
dens(k) = NaN;
|
||||
end
|
||||
end
|
||||
end
|
||||
binf = abscissa(1);
|
||||
bsup = abscissa(end);
|
||||
x = abscissa;
|
||||
f = dens;
|
||||
f = dens;
|
||||
|
|
|
@ -373,7 +373,7 @@ if ~issmc(options_) && any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode
|
|||
oo_.MarginalDensity.LaplaceApproximation = NaN;
|
||||
end
|
||||
skipline()
|
||||
disp(sprintf('Log data density [Laplace approximation] is %f.',oo_.MarginalDensity.LaplaceApproximation))
|
||||
dprintf('Log data density [Laplace approximation] is %f.', oo_.MarginalDensity.LaplaceApproximation)
|
||||
skipline()
|
||||
end
|
||||
if options_.dsge_var
|
||||
|
|
|
@ -54,7 +54,7 @@ function [xparams, lpd, hessian_mat] = ...
|
|||
names, ...
|
||||
[], ...
|
||||
[], ...
|
||||
Prior,
|
||||
Prior, ...
|
||||
options_, ...
|
||||
M_, ...
|
||||
estim_params_, ...
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function [fval, info, exitflag, ~, ~] = minus_logged_prior_density(xparams, Prior, options_, M_, estim_params_, oo_)
|
||||
function [fval, info, exitflag, fake1, fake2] = minus_logged_prior_density(xparams, Prior, options_, M_, estim_params_, oo_)
|
||||
|
||||
% Evaluates minus the logged prior density.
|
||||
%
|
||||
|
@ -33,6 +33,8 @@ function [fval, info, exitflag, ~, ~] = minus_logged_prior_density(xparams, Prio
|
|||
|
||||
exitflag = true;
|
||||
info = zeros(4,1);
|
||||
fake1 = [];
|
||||
fake2 = [];
|
||||
|
||||
%------------------------------------------------------------------------------
|
||||
% 1. Get the structural parameters & define penalties
|
||||
|
|
|
@ -87,7 +87,7 @@ for i=1:NumberOfModels
|
|||
end
|
||||
end
|
||||
try
|
||||
eval(['MarginalLogDensity(i) = mstruct.oo_.MarginalDensity.' type ';'])
|
||||
MarginalLogDensity(i) = mstruct.oo_.MarginalDensity.(type);
|
||||
catch
|
||||
if strcmpi(type,'LaplaceApproximation')
|
||||
if isfield(mstruct.oo_,'mle_mode')
|
||||
|
|
|
@ -125,7 +125,7 @@ switch posterior_sampling_method
|
|||
% check whether draw is valid and compute posterior
|
||||
if all( proposed_par(:) > mh_bounds.lb(indices(blocks==block_iter,1),:) ) && all( proposed_par(:) < mh_bounds.ub(indices(blocks==block_iter,1),:) )
|
||||
try
|
||||
logpost = - feval('TaRB_optimizer_wrapper', proposed_par(:),...
|
||||
logpost = - TaRB_optimizer_wrapper(proposed_par(:),...
|
||||
current_draw,indices(blocks==block_iter,1),TargetFun,...% inputs for wrapper
|
||||
varargin{:});
|
||||
catch
|
||||
|
|
|
@ -36,24 +36,24 @@ function indx = get_new_or_existing_ei_index(substructure_name, name1, name2)
|
|||
|
||||
global estimation_info
|
||||
|
||||
if eval(['isempty(estimation_info.' substructure_name ')'])
|
||||
if isempty(estimation_info.(substructure_name))
|
||||
indx = 1;
|
||||
return
|
||||
end
|
||||
|
||||
if isempty(name2) % parameter or std() statement
|
||||
indx = eval(['find(strcmp(name1, estimation_info.' substructure_name ') == 1)']);
|
||||
indx = find(strcmp(name1, estimation_info.(substructure_name)));
|
||||
else % corr statement
|
||||
indx = eval(['find(strcmp([''' name1 ':' name2 '''], estimation_info.' substructure_name ') == 1)']);
|
||||
indx = find(strcmp(sprintf('%s:%s', name1, name2), estimation_info.(substructure_name)));
|
||||
if isempty(indx)
|
||||
indx = eval(['find(strcmp([''' name2 ':' name1 '''], estimation_info.' substructure_name ') == 1)']);
|
||||
indx = find(strcmp(sprintf('%s:%s', name2, name1), estimation_info.(substructure_name)));
|
||||
end
|
||||
end
|
||||
|
||||
if isempty(indx)
|
||||
indx = eval(['size(estimation_info.' substructure_name ', 2) + 1']);
|
||||
indx = size(estimation_info.(substructure_name), 2) + 1;
|
||||
end
|
||||
|
||||
if size(indx, 2) > 1
|
||||
error(['Error: ' name1 ' ' name2 'found more than once in estimation_info.subsamples_index']);
|
||||
error('Error: %s %s found more than once in estimation_info.subsamples_index', name1, name2);
|
||||
end
|
||||
|
|
|
@ -194,13 +194,10 @@ while notsteady && t<=last
|
|||
end
|
||||
end
|
||||
if badly_conditioned_F
|
||||
if ~all(abs(F(:))<kalman_tol)
|
||||
% Use univariate filter (will remove observations with zero variance prediction error)
|
||||
return
|
||||
else
|
||||
% Pathological case, discard draw.
|
||||
return
|
||||
end
|
||||
% if ~all(abs(F(:))<kalman_tol), then use univariate filter (will remove
|
||||
% observations with zero variance prediction error), otherwise this is a
|
||||
% pathological case and the draw is discarded
|
||||
return
|
||||
else
|
||||
F_singular = false;
|
||||
if rescale_prediction_error_covariance
|
||||
|
|
|
@ -87,13 +87,9 @@ while rank(Z*Pinf*Z',diffuse_kalman_tol) && (t<=last)
|
|||
else %rank of F_{\infty,t} is 0
|
||||
Fstar = Z*Pstar*Z' + H; % (5.7) in DK (2012)
|
||||
if rcond(Fstar) < kalman_tol %F_{*} is singular
|
||||
if ~all(abs(Fstar(:))<kalman_tol)
|
||||
% The univariate diffuse kalman filter should be used.
|
||||
return
|
||||
else %rank 0
|
||||
%pathological case, discard draw
|
||||
return
|
||||
end
|
||||
% if ~all(abs(Fstar(:))<kalman_tol), then use univariate diffuse filter,
|
||||
% otherwise this is a pathological case and the draw is discarded
|
||||
return
|
||||
else
|
||||
iFstar = inv(Fstar);
|
||||
dFstar = det(Fstar);
|
||||
|
|
|
@ -151,13 +151,9 @@ while notsteady && t<=last
|
|||
v = Y(:,t)-a(Z);
|
||||
end
|
||||
if rcond(F) < kalman_tol
|
||||
if ~all(abs(F(:))<kalman_tol)
|
||||
% The univariate diffuse kalman filter should be used.
|
||||
return
|
||||
else
|
||||
%pathological case, discard draw
|
||||
return
|
||||
end
|
||||
% if ~all(abs(F(:))<kalman_tol), then use univariate diffuse filter, otherwise
|
||||
% this is a pathological case and the draw is discarded
|
||||
return
|
||||
else
|
||||
F_singular = 0;
|
||||
dF = det(F);
|
||||
|
|
|
@ -191,13 +191,9 @@ while notsteady && t<=last
|
|||
end
|
||||
end
|
||||
if badly_conditioned_F && (~occbin_.status || (occbin_.status && t<first_period_occbin_update))
|
||||
if ~all(abs(F(:))<kalman_tol)
|
||||
% Use univariate filter.
|
||||
return
|
||||
else
|
||||
% Pathological case, discard draw
|
||||
return
|
||||
end
|
||||
% if ~all(abs(F(:))<kalman_tol), then use univariate filter, otherwise this is a
|
||||
% pathological case and the draw is discarded
|
||||
return
|
||||
else
|
||||
F_singular = false;
|
||||
end
|
||||
|
|
|
@ -105,13 +105,9 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
|
|||
else %rank of F_{\infty,t} is 0
|
||||
Fstar = ZZ*Pstar*ZZ' + H(d_index,d_index); % (5.7) in DK (2012)
|
||||
if rcond(Fstar) < kalman_tol %F_{*} is singular
|
||||
if ~all(abs(Fstar(:))<kalman_tol)
|
||||
% The univariate diffuse kalman filter should be used.
|
||||
return
|
||||
else %rank 0
|
||||
%pathological case, discard draw
|
||||
return
|
||||
end
|
||||
% if ~all(abs(Fstar(:))<kalman_tol), then use univariate diffuse filter,
|
||||
% otherwise this is a pathological case and the draw is discarded
|
||||
return
|
||||
else
|
||||
iFstar = inv(Fstar);
|
||||
dFstar = det(Fstar);
|
||||
|
|
|
@ -57,8 +57,7 @@ for i=1:size(etags,1)
|
|||
if ~isempty(kop)
|
||||
k = find(strcmp(strtrim(str(1:kop-1)), M_.endo_names)); %get variable index with restriction
|
||||
if isempty(k)
|
||||
error(sprintf(['Complementarity condition %s: variable %s is ' ...
|
||||
'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
|
||||
error('Complementarity condition %s: variable %s is not recognized', etags{i,3}, strtrim(str(1:kop-1)))
|
||||
end
|
||||
ub(k) = str2num(str(kop+1:end));
|
||||
eq_index(eq_nbr) = k;
|
||||
|
@ -68,15 +67,13 @@ for i=1:size(etags,1)
|
|||
if ~isempty(kop)
|
||||
k = find(strcmp(strtrim(str(1:kop-1)), M_.endo_names)); %get variable index with restriction
|
||||
if isempty(k)
|
||||
error(sprintf(['Complementarity condition %s: variable %s is ' ...
|
||||
'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
|
||||
error('Complementarity condition %s: variable %s is not recognized', etags{i,3}, strtrim(str(1:kop-1)))
|
||||
end
|
||||
lb(k) = str2num(str(kop+1:end));
|
||||
eq_index(eq_nbr) = k;
|
||||
eq_index(k) = eq_nbr;
|
||||
else
|
||||
error(sprintf(['Complementarity condition %s can''t be ' ...
|
||||
'parsed'],etags{i,3}))
|
||||
error('Complementarity condition %s can''t be parsed',etags{i,3})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a3874403fe5b403f74d727006cb4ccf198cf63c8
|
||||
Subproject commit 8acb7f8d5f6418717a9ad47e6b6b911354a86409
|
|
@ -130,7 +130,7 @@ for k=1:nvar
|
|||
for draws = 1:ndraws1
|
||||
if ~mod(draws,nbuffer)
|
||||
skipline()
|
||||
disp(sprintf('The %dth column or equation in A0 with %d 1st tossed-away draws in Gibbs',k,draws))
|
||||
dprintf('The %dth column or equation in A0 with %d 1st tossed-away draws in Gibbs', k, draws)
|
||||
end
|
||||
A0gbs1 = fn_gibbsrvar(A0gbs0,UT,nvar,fss,n0,indx_ks);
|
||||
A0gbs0=A0gbs1; % repeat the Gibbs sampling
|
||||
|
@ -141,7 +141,7 @@ for k=1:nvar
|
|||
for draws = 1:ndraws2
|
||||
if ~mod(draws,nbuffer)
|
||||
skipline()
|
||||
disp(sprintf('The %dth column or equation in A0 with %d usable draws in Gibbs',k,draws))
|
||||
dprintf('The %dth column or equation in A0 with %d usable draws in Gibbs', k, draws)
|
||||
end
|
||||
[A0gbs1, Wcell] = fn_gibbsrvar(A0gbs0,UT,nvar,fss,n0,indx_ks);
|
||||
%------ See p.71, Forecast (II).
|
||||
|
@ -163,7 +163,7 @@ for k=1:nvar
|
|||
% The log value of p(a0_k|Y,a_others) where a_others: other a's at some point such as the peak of ONLY some a0's
|
||||
else
|
||||
skipline()
|
||||
disp(sprintf('The last(6th) column or equation in A0 with no Gibbs draws'))
|
||||
disp('The last(6th) column or equation in A0 with no Gibbs draws')
|
||||
[A0gbs1, Wcell] = fn_gibbsrvar(A0gbs0,UT,nvar,fss,n0,indx_ks)
|
||||
%------ See p.71, Forecast (II).
|
||||
%------ Computing p(a0_k|Y,a_others) at some point such as the peak along the dimensions of indx_ks.
|
||||
|
|
|
@ -1739,7 +1739,7 @@ while irun <= myeval(opts.Restarts) % for-loop does not work with resume
|
|||
if N < 102
|
||||
disp(['mean solution:' sprintf(' %+.1e', xmean)]);
|
||||
disp(['std deviation:' sprintf(' %.1e', sigma*sqrt(diagC))]);
|
||||
disp(sprintf('use plotcmaesdat.m for plotting the output at any time (option LogModulo must not be zero)'));
|
||||
dprintf('use plotcmaesdat.m for plotting the output at any time (option LogModulo must not be zero)');
|
||||
end
|
||||
if exist('sfile', 'var')
|
||||
disp(['Results saved in ' sfile]);
|
||||
|
@ -1944,7 +1944,7 @@ end
|
|||
% ---------------------------------------------------------------
|
||||
function flush
|
||||
if isoctave
|
||||
feval('fflush', stdout);
|
||||
fflush(stdout);
|
||||
end
|
||||
|
||||
% ---------------------------------------------------------------
|
||||
|
@ -2256,7 +2256,7 @@ ax(2) = max(minxend, ax(2));
|
|||
axis(ax);
|
||||
|
||||
% add some annotation lines
|
||||
[ignore idx] = sort(d.x(end,6:end));
|
||||
[ignore, idx] = sort(d.x(end,6:end));
|
||||
% choose no more than 25 indices
|
||||
idxs = round(linspace(1, size(d.x,2)-5, min(size(d.x,2)-5, 25)));
|
||||
yy = repmat(NaN, 2, size(d.x,2)-5);
|
||||
|
|
|
@ -384,19 +384,19 @@ while (func_count < max_func_calls) && (iter_count < max_iterations) && (simplex
|
|||
fval_(1:length(fval)) = fval;
|
||||
if isfinite(fv(end)) && isfinite(fv(1))
|
||||
if fv(end)<0
|
||||
disp(sprintf('%s %s %12.7E %12.7E %12.7E %12.7E %s', iter_, fval_, fv(1), fv(end), critF, critX, move))
|
||||
dprintf('%s %s %12.7E %12.7E %12.7E %12.7E %s', iter_, fval_, fv(1), fv(end), critF, critX, move)
|
||||
else
|
||||
if fv(1)>0
|
||||
disp(sprintf('%s %s %12.7E %12.7E %12.7E %12.7E %s', iter_, fval_, fv(1), fv(end), critF, critX, move))
|
||||
dprintf('%s %s %12.7E %12.7E %12.7E %12.7E %s', iter_, fval_, fv(1), fv(end), critF, critX, move)
|
||||
else
|
||||
disp(sprintf('%s %s %12.7E %12.7E %12.7E %12.7E %s', iter_, fval_, fv(1), fv(end), critF, critX, move))
|
||||
dprintf('%s %s %12.7E %12.7E %12.7E %12.7E %s', iter_, fval_, fv(1), fv(end), critF, critX, move)
|
||||
end
|
||||
end
|
||||
else
|
||||
if isfinite(fv(1))
|
||||
disp(sprintf(['%s %s %12.7E %12.7E %s'], iter_, fval_, fv(1) , critX, move))
|
||||
dprintf(['%s %s %12.7E %12.7E %s'], iter_, fval_, fv(1) , critX, move)
|
||||
else
|
||||
disp(sprintf('%s %s %12.7E %s', iter_, fval_, critX, move))
|
||||
dprintf('%s %s %12.7E %s', iter_, fval_, critX, move)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -551,4 +551,4 @@ for j = 1:n
|
|||
end
|
||||
% Sort by increasing order of the objective function values.
|
||||
[fv,sort_idx] = sort(fv);
|
||||
v = v(:,sort_idx);
|
||||
v = v(:,sort_idx);
|
||||
|
|
|
@ -264,7 +264,7 @@ while 1
|
|||
if nITERATIONS == 0
|
||||
disp(' Nr Iter Nr Fun Eval Min function Best function TEMP Algorithm Step');
|
||||
else
|
||||
disp(sprintf('%5.0f %5.0f %12.6g %15.6g %12.6g %s',nITERATIONS,nFUN_EVALS,Y(1),YBEST,TEMP,'best point'));
|
||||
dprintf('%5.0f %5.0f %12.6g %15.6g %12.6g %s',nITERATIONS,nFUN_EVALS,Y(1),YBEST,TEMP,'best point');
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -319,7 +319,7 @@ while 1
|
|||
end
|
||||
|
||||
if strcmp(OPTIONS.DISPLAY,'iter')
|
||||
disp(sprintf('%5.0f %5.0f %12.6g %15.6g %12.6g %s',nITERATIONS,nFUN_EVALS,Y(1),YBEST,TEMP,ALGOSTEP));
|
||||
dprintf('%5.0f %5.0f %12.6g %15.6g %12.6g %s',nITERATIONS,nFUN_EVALS,Y(1),YBEST,TEMP,ALGOSTEP);
|
||||
end
|
||||
|
||||
% if output function given then run output function to plot intermediate result
|
||||
|
|
|
@ -175,12 +175,12 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for'
|
|||
|
||||
if Environment
|
||||
if OScallerWindows
|
||||
[si1 de1]=system(['ping ', DataInput(Node).ComputerName]);
|
||||
[si1, de1]=system(['ping ', DataInput(Node).ComputerName]);
|
||||
else
|
||||
[si1 de1]=system(['ping ', DataInput(Node).ComputerName, ' -c 4']);
|
||||
[si1, de1]=system(['ping ', DataInput(Node).ComputerName, ' -c 4']);
|
||||
end
|
||||
else
|
||||
[si1 de1]=system(['ping ', DataInput(Node).ComputerName]);
|
||||
[si1, de1]=system(['ping ', DataInput(Node).ComputerName]);
|
||||
end
|
||||
|
||||
if (si1)
|
||||
|
@ -387,15 +387,15 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for'
|
|||
else
|
||||
if ~strcmp(DataInput(Node).ComputerName,MasterName) % run on remote machine
|
||||
if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
|
||||
[NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']);
|
||||
[NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']);
|
||||
else
|
||||
[NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']);
|
||||
[NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e -u ',DataInput(Node).UserName,' -p ',DataInput(Node).Password,' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']);
|
||||
end
|
||||
else % run on local machine via the network: user and passwd cannot be used!
|
||||
if strfind([DataInput(Node).MatlabOctavePath], 'octave') % Hybrid computing Matlab(Master)->Octave(Slaves) and Vice Versa!
|
||||
[NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']);
|
||||
[NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' Tracing.m']);
|
||||
else
|
||||
[NonServeS NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']);
|
||||
[NonServeS, NenServeD]=system(['start /B psexec \\',DataInput(Node).ComputerName,' -e ',' -W ',DataInput(Node).RemoteDrive,':\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder ' -low ',DataInput(Node).MatlabOctavePath,' -nosplash -nodesktop -minimize -r Tracing']);
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -570,7 +570,7 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for'
|
|||
|
||||
% Questo controllo penso che si possa MIGLIORARE!!!!!
|
||||
if isempty (RealCPUnbr) && Environment1==0
|
||||
[si0 de0]=system(['psinfo \\',DataInput(Node).ComputerName]);
|
||||
[si0, de0]=system(['psinfo \\',DataInput(Node).ComputerName]);
|
||||
end
|
||||
RealCPUnbr=GiveCPUnumber(de0,Environment1);
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ if SumOfJobs~=NumbersOfJobs
|
|||
% Many choices are possible:
|
||||
% - ... (see above).
|
||||
|
||||
[NonServe VeryFast]= min(CPUWeight);
|
||||
[NonServe, VeryFast]= min(CPUWeight);
|
||||
|
||||
while SumOfJobs<NumbersOfJobs
|
||||
JobsForNode(VeryFast)=JobsForNode(VeryFast)+1;
|
||||
|
|
|
@ -59,7 +59,7 @@ for indPC=1:length(Parallel)
|
|||
if isoctave % Patch for peculiar behaviour of ls under Linux.
|
||||
|
||||
% It is necessary to capture the ls warning message and properly manage the jolly char '*'!
|
||||
[check ax]=system(['ls ' ,filename, ' 2> OctaveStandardOutputMessage.txt']);
|
||||
[check, ax]=system(['ls ' ,filename, ' 2> OctaveStandardOutputMessage.txt']);
|
||||
|
||||
if check ~= 0 || ~isempty(strfind(ax,'No such file or directory'))
|
||||
ax=[];
|
||||
|
|
|
@ -61,13 +61,13 @@ for indPC=1:length(Parallel)
|
|||
|
||||
if isempty (FindAst)
|
||||
|
||||
[NonServeL NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]);
|
||||
[NonServeL, NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]);
|
||||
|
||||
else
|
||||
|
||||
filenameTemp=NamFileInput{jfil,2};
|
||||
|
||||
[NotUsed FlI]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filenameTemp, ' 2> OctaveStandardOutputMessage.txt']);
|
||||
[NotUsed, FlI]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filenameTemp, ' 2> OctaveStandardOutputMessage.txt']);
|
||||
|
||||
if isempty (FlI)
|
||||
return
|
||||
|
@ -81,13 +81,13 @@ for indPC=1:length(Parallel)
|
|||
for i=1: NumFileToCopy
|
||||
Ni=num2str(i);
|
||||
filenameTemp(1,AstPos)=Ni;
|
||||
[NonServeL NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},filenameTemp,' ',NamFileInput{jfil,1}]);
|
||||
[NonServeL, NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},filenameTemp,' ',NamFileInput{jfil,1}]);
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
[NonServeL NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]);
|
||||
[NonServeL, NonServeR]= system(['scp ',scp_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,':',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]);
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -710,11 +710,7 @@ if parallel_recover ==0
|
|||
pcerdone(j) = prtfrc;
|
||||
idCPU(j) = njob;
|
||||
if isoctave || options_.console_mode
|
||||
if (~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem))
|
||||
statusString = [statusString, int2str(j), ' %3.f%% done! '];
|
||||
else
|
||||
statusString = [statusString, int2str(j), ' %3.f%% done! '];
|
||||
end
|
||||
statusString = [statusString, int2str(j), ' %3.f%% done! '];
|
||||
else
|
||||
status_String{j} = waitbarString;
|
||||
status_Title{j} = waitbarTitle;
|
||||
|
@ -722,11 +718,7 @@ if parallel_recover ==0
|
|||
catch % ME
|
||||
% To define!
|
||||
if isoctave || options_.console_mode
|
||||
if (~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem))
|
||||
statusString = [statusString, int2str(j), ' %3.f%% done! '];
|
||||
else
|
||||
statusString = [statusString, int2str(j), ' %3.f%% done! '];
|
||||
end
|
||||
statusString = [statusString, int2str(j), ' %3.f%% done! '];
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -901,7 +893,7 @@ switch Strategy
|
|||
end
|
||||
|
||||
if isempty(dir('dynareParallelLogFiles'))
|
||||
[A B C]=rmdir('dynareParallelLogFiles');
|
||||
[A, B, C]=rmdir('dynareParallelLogFiles');
|
||||
mkdir('dynareParallelLogFiles');
|
||||
end
|
||||
try
|
||||
|
@ -919,7 +911,7 @@ switch Strategy
|
|||
delete(['temp_input.mat'])
|
||||
if newInstance
|
||||
if isempty(dir('dynareParallelLogFiles'))
|
||||
[A B C]=rmdir('dynareParallelLogFiles');
|
||||
[A, B, C]=rmdir('dynareParallelLogFiles');
|
||||
mkdir('dynareParallelLogFiles');
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,14 +31,14 @@ function storeGlobalVars(fname,append)
|
|||
|
||||
|
||||
GlobalNames = who('global');
|
||||
% varlist = '';
|
||||
|
||||
for j=1:length(GlobalNames)
|
||||
eval(['global ',GlobalNames{j},';']);
|
||||
eval(['fGlobalVar.',GlobalNames{j},'=',GlobalNames{j},';']);
|
||||
fGlobalvar.(GlobalNames{j}) = GlobalNames{j};
|
||||
end
|
||||
|
||||
if nargin<2
|
||||
save(fname,'fGlobalVar');
|
||||
else
|
||||
save(fname,'fGlobalVar','-append');
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,7 +76,7 @@ try
|
|||
warning('off','MATLAB:nearlySingularMatrix');
|
||||
warning('off','MATLAB:singularMatrix');
|
||||
UAVinv=inv(C2); % i.e. inv(U02'*a1*V02)
|
||||
[LastWarningTxt LastWarningID]=lastwarn;
|
||||
[LastWarningTxt, LastWarningID]=lastwarn;
|
||||
if any(any(isinf(UAVinv)))==1
|
||||
singular=1;
|
||||
end
|
||||
|
@ -178,9 +178,9 @@ G0pi=eye(n+FL_RANK+NX);
|
|||
try
|
||||
if isoctave && octave_ver_less_than('9')
|
||||
% Need to force QZ complex on Octave ⩽ 8 (otherwise it returns the real one)
|
||||
[a b q z]=qz(complex(G0pi),complex(G1pi));
|
||||
[a, b, q, z]=qz(complex(G0pi),complex(G1pi));
|
||||
else
|
||||
[a b q z]=qz(G0pi,G1pi);
|
||||
[a, b, q, z]=qz(G0pi,G1pi);
|
||||
end
|
||||
catch
|
||||
try
|
||||
|
@ -239,7 +239,7 @@ for i=1:nn
|
|||
end
|
||||
div ;
|
||||
if ~zxz
|
||||
[a b q z]=qzdiv(div,a,b,q,z);
|
||||
[a, b, q, z]=qzdiv(div,a,b,q,z);
|
||||
end
|
||||
|
||||
gev=[diag(a) diag(b)];
|
||||
|
|
|
@ -71,7 +71,7 @@ try
|
|||
singular=1;
|
||||
else
|
||||
UAVinv=inv(C2);
|
||||
[LastWarningTxt LastWarningID]=lastwarn;
|
||||
[LastWarningTxt, LastWarningID]=lastwarn;
|
||||
if any(any(isinf(UAVinv)))==1
|
||||
singular=1;
|
||||
end
|
||||
|
|
|
@ -888,7 +888,7 @@ else
|
|||
% in case of mixed surprise and perfect foresight on the
|
||||
% endogenous path, at each date all the exogenous paths have to be
|
||||
% stored. The paths are stacked in exo.
|
||||
for time = time_index_constraint;
|
||||
for time = time_index_constraint
|
||||
exo(past_val + time,j_pos) = oo_.exo_simul(time,j_pos);
|
||||
end
|
||||
else
|
||||
|
|
|
@ -48,7 +48,7 @@ else
|
|||
end
|
||||
if options_.verbosity
|
||||
printline(41)
|
||||
disp(sprintf('MODEL SIMULATION (method=%s):',mthd))
|
||||
dprintf('MODEL SIMULATION (method=%s):', mthd)
|
||||
skipline()
|
||||
end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ function print_expectations(eqname, expectationmodelname, expectationmodelkind,
|
|||
%
|
||||
% The variable expectationmodelkind can take two values 'var' or 'pac'.
|
||||
|
||||
% Copyright © 2018-2021 Dynare Team
|
||||
% Copyright © 2018-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -347,7 +347,7 @@ for i=1:maxlag
|
|||
for k=1:length(expectationmodel.components)
|
||||
parameter = M_.params(expectationmodel.components(k).h_param_indices(id));
|
||||
if parameter>=0
|
||||
expressions{k} = sprintf('%s+%1.16f*%s', expressions{k}, parameter, variable);;
|
||||
expressions{k} = sprintf('%s+%1.16f*%s', expressions{k}, parameter, variable);
|
||||
else
|
||||
expressions{k} = sprintf('%s-%1.16f*%s', expressions{k}, -parameter, variable);
|
||||
end
|
||||
|
|
|
@ -126,5 +126,4 @@ switch (extension)
|
|||
end
|
||||
|
||||
cd(old_pwd)
|
||||
disp(sprintf('Loading %d observations from %s\n',...
|
||||
size(dyn_data_01,1),fullname))
|
||||
dprintf('Loading %d observations from %s', size(dyn_data_01, 1), fullname)
|
||||
|
|
|
@ -108,7 +108,7 @@ end
|
|||
if abs(floor(x(1))-xind_tick(1))-abs(ceil(x(end))-xind_tick(end))<-1
|
||||
xind_tick = xind_tick+1;
|
||||
end
|
||||
if length(xind_tick)==gend,
|
||||
if length(xind_tick)==gend
|
||||
xind_tick = x(2:end);
|
||||
end
|
||||
% xind_tick = [x(ind_yrs(1))-floor(dind_tick/2):dind_tick:x(ind_yrs(end))+floor(dind_tick/2)]+1;
|
||||
|
@ -154,7 +154,7 @@ comp_nbr0=comp_nbr;
|
|||
%%plot decomposition
|
||||
for j=1:nvar
|
||||
z1 = squeeze(z(i_var(j),:,:));
|
||||
if screen_shocks,
|
||||
if screen_shocks
|
||||
[~, isort] = sort(mean(abs(z1(1:end-2,:)')), 'descend');
|
||||
if initval
|
||||
labels = char(char(shock_names(isort(1:16))),'Others', 'All shocks');
|
||||
|
|
|
@ -82,7 +82,7 @@ function varargout = colorspace(Conversion,varargin)
|
|||
% ("short").
|
||||
|
||||
% Copyright © 2005-2010 Pascal Getreuer
|
||||
% Copyright © 2017 Dynare Team
|
||||
% Copyright © 2017-2023 Dynare Team
|
||||
%
|
||||
% Redistribution and use in source and binary forms, with or without
|
||||
% modification, are permitted provided that the following conditions are
|
||||
|
@ -203,7 +203,7 @@ switch Space
|
|||
Space = 'hsv';
|
||||
case {'hsl','hsi','hls'}
|
||||
Space = 'hsl';
|
||||
case {'rgb','yuv','yiq','ydbdr','ycbcr','jpegycbcr','xyz','lab','luv','lch'}
|
||||
case {'rgb','yuv','yiq','ydbdr','jpegycbcr','xyz','lab','luv','lch'}
|
||||
return
|
||||
end
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue