Remove unnecessary square brackets.

covariance-quadratic-approximation
Stéphane Adjemian (Ryûk) 2023-12-18 10:49:49 +01:00
parent c399f54581
commit 4982ce06b4
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
95 changed files with 182 additions and 182 deletions

View File

@ -95,7 +95,7 @@ end
if p > 0 if p > 0
skipline() skipline()
disp(['Some of the VAR models sampled from the posterior distribution']) disp('Some of the VAR models sampled from the posterior distribution')
disp(['were found to be explosive (' num2str(p/options_.bvar_replic) ' percent).']) disp(['were found to be explosive (' num2str(p/options_.bvar_replic) ' percent).'])
skipline() skipline()
end end

View File

@ -96,7 +96,7 @@ end
if p > 0 if p > 0
skipline() skipline()
disp(['Some of the VAR models sampled from the posterior distribution']) disp('Some of the VAR models sampled from the posterior distribution')
disp(['were found to be explosive (' int2str(p) ' samples).']) disp(['were found to be explosive (' int2str(p) ' samples).'])
skipline() skipline()
end end

View File

@ -147,7 +147,7 @@ for i=1:r
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% a --> Define the random vector x0 for the factors. Note that x0 takes value in the hypercube % a --> Define the random vector x0 for the factors. Note that x0 takes value in the hypercube
% [0,...,1-Delta]*[0,...,1-Delta]*[0,...,1-Delta]*[0,...,1-Delta] % [0,...,1-Delta]*[0,...,1-Delta]*[0,...,1-Delta]*[0,...,1-Delta]
MyInt = repmat([0:(1/(p-1)):(1-Delta)],NumFact,1); % Construct all possible values of the factors MyInt = repmat(0:(1/(p-1)):(1-Delta),NumFact,1); % Construct all possible values of the factors
% OLD VERSION - it needs communication toolbox % OLD VERSION - it needs communication toolbox
% w = randint(NumFact,1,[1,size(MyInt,2)]); % w = randint(NumFact,1,[1,size(MyInt,2)]);

View File

@ -94,7 +94,7 @@ if param_nbr > 0 && (rankX<rankrequired)
% search for singular values associated to ONE individual parameter % search for singular values associated to ONE individual parameter
% Compute an orthonormal basis for the null space using the columns of ee1 that correspond % Compute an orthonormal basis for the null space using the columns of ee1 that correspond
% to singular values equal to zero and associated to an individual parameter % to singular values equal to zero and associated to an individual parameter
ee0 = [rankX+1:size([Xparnonzero Xrest],2)]; %look into last columns with singular values of problematic parameter sets (except single parameters) ee0 = rankX+1:size([Xparnonzero Xrest],2); %look into last columns with singular values of problematic parameter sets (except single parameters)
ind11 = ones(length(ind1),1); %initialize ind11 = ones(length(ind1),1); %initialize
for j=1:length(ee0) for j=1:length(ee0)
% check if nullspace is spanned by only one parameter % check if nullspace is spanned by only one parameter
@ -151,9 +151,9 @@ if param_nbr>0 && (rankX<rankrequired || min(1-Mco)<tol_rank)
if length(ind1)<param_nbr if length(ind1)<param_nbr
% single parameters with zero columns % single parameters with zero columns
ixno = ixno + 1; ixno = ixno + 1;
indno(ixno,:) = (~ismember([1:param_nbr],ind1)); indno(ixno,:) = (~ismember(1:param_nbr,ind1));
end end
ee0 = [rankX+1:size([Xparnonzero Xrest],2)]; %look into last columns with singular values of problematic parameter sets (except single parameters) ee0 = rankX+1:size([Xparnonzero Xrest],2); %look into last columns with singular values of problematic parameter sets (except single parameters)
for j=1:length(ee0) for j=1:length(ee0)
% linearly dependent parameters % linearly dependent parameters
ixno = ixno + 1; ixno = ixno + 1;

View File

@ -54,7 +54,7 @@ tol_rank = options_ident.tol_rank;
checks_via_subsets = options_ident.checks_via_subsets; checks_via_subsets = options_ident.checks_via_subsets;
%% Display settings %% Display settings
disp([' ']), disp(' '),
fprintf('Note that differences in the criteria could be due to numerical settings,\n') fprintf('Note that differences in the criteria could be due to numerical settings,\n')
fprintf('numerical errors or the method used to find problematic parameter sets.\n') fprintf('numerical errors or the method used to find problematic parameter sets.\n')
fprintf('Settings:\n') fprintf('Settings:\n')
@ -157,7 +157,7 @@ for jide = 1:4
disp(' !!!WARNING!!!'); disp(' !!!WARNING!!!');
if SampleSize>1 if SampleSize>1
if non_minimal_state_space_error if non_minimal_state_space_error
fprintf(['\n The minimal state space could not be computed for %u out of %u cases.\n'],SampleSize-EffectiveSampleSize,SampleSize); fprintf('\n The minimal state space could not be computed for %u out of %u cases.\n',SampleSize-EffectiveSampleSize,SampleSize);
end end
if jide==2 if jide==2
if sum(ide.ino & ide.minimal_state_space)>0 if sum(ide.ino & ide.minimal_state_space)>0

View File

@ -236,7 +236,7 @@ if strcmp(options_mom_.mom.mom_method,'SMM')
% remove burn-in and focus on observables (note that y_sim is in declaration order) % remove burn-in and focus on observables (note that y_sim is in declaration order)
y_sim = y_sim(oo_.dr.order_var(oo_.mom.obs_var) , end-options_mom_.mom.long+1:end)'; y_sim = y_sim(oo_.dr.order_var(oo_.mom.obs_var) , end-options_mom_.mom.long+1:end)';
if ~all(diag(M_.H)==0) if ~all(diag(M_.H)==0)
i_ME = setdiff([1:size(M_.H,1)],find(diag(M_.H) == 0)); % find ME with 0 variance i_ME = setdiff(1:size(M_.H,1),find(diag(M_.H) == 0)); % find ME with 0 variance
chol_S = chol(M_.H(i_ME,i_ME)); % decompose rest chol_S = chol(M_.H(i_ME,i_ME)); % decompose rest
shock_mat=zeros(size(options_mom_.mom.ME_shock_series)); % initialize shock_mat=zeros(size(options_mom_.mom.ME_shock_series)); % initialize
shock_mat(:,i_ME)=options_mom_.mom.ME_shock_series(:,i_ME)*chol_S; shock_mat(:,i_ME)=options_mom_.mom.ME_shock_series(:,i_ME)*chol_S;

View File

@ -109,7 +109,7 @@ for fig = 1:nbplt
if ndim==2 if ndim==2
legend([h1,h2],legend_list,'box','off') legend([h1,h2],legend_list,'box','off')
else else
legend([h1],legend_list,'box','off') legend(h1,legend_list,'box','off')
end end
end end
if options_.TeX if options_.TeX

View File

@ -76,8 +76,8 @@ if odd
end end
y = y*rho; y = y*rho;
end end
y = prod([1:2:s1])*prod([1:2:s2])*y; y = prod(1:2:s1)*prod(1:2:s2)*y;
if nargout > 1 if nargout > 1
dy = prod([1:2:s1])*prod([1:2:s2])*dy; dy = prod(1:2:s1)*prod(1:2:s2)*dy;
end end

View File

@ -61,7 +61,7 @@ s2 = s/2;
% Use univariate normal results % Use univariate normal results
% %
if m==1 if m==1
y = V^s2*prod([1:2:s-1]); y = V^s2*prod(1:2:s-1);
return return
end end
% %
@ -104,4 +104,4 @@ for i=1:fix(prod(nu+1)/2)
end end
end end
end end
y = y/prod([1:s2]); y = y/prod(1:s2);

View File

@ -82,9 +82,9 @@ s2 = s/2;
% Use univariate normal results % Use univariate normal results
% %
if m==1 if m==1
y = V^s2*prod([1:2:s-1]); y = V^s2*prod(1:2:s-1);
if nargout > 1 if nargout > 1
dy = s2*V^(s2-1)*dV*prod([1:2:s-1]); dy = s2*V^(s2-1)*dV*prod(1:2:s-1);
dy = reshape(dy,1,size(dV,3)); dy = reshape(dy,1,size(dV,3));
end end
return return
@ -169,8 +169,8 @@ for i=1:fix(prod(nu+1)/2)
end end
end end
end end
y = y/prod([1:s2]); y = y/prod(1:s2);
if nargout > 1 if nargout > 1
dy = dy/prod([1:s2]); dy = dy/prod(1:s2);
dy = reshape(dy,1,size(dV,3)); dy = reshape(dy,1,size(dV,3));
end end

View File

@ -31,7 +31,7 @@ global M_ options_ oo_
% Check that the model is actually backward % Check that the model is actually backward
if M_.maximum_lead if M_.maximum_lead
error(['backward_model_forecast:: The specified model is not backward looking!']) error('backward_model_forecast:: The specified model is not backward looking!')
end end
% Initialize returned argument. % Initialize returned argument.

View File

@ -72,7 +72,7 @@ elseif isempty(varlist) && ~isempty(options_.endo_vars_for_moment_computations_i
end end
elseif isempty(varlist) && isempty(options_.endo_vars_for_moment_computations_in_estimation) elseif isempty(varlist) && isempty(options_.endo_vars_for_moment_computations_in_estimation)
skipline() skipline()
disp(['You did not declare endogenous variables after the estimation/calib_smoother command.']) disp('You did not declare endogenous variables after the estimation/calib_smoother command.')
cas = ''; cas = '';
if options_.bayesian_irf if options_.bayesian_irf
cas = 'Posterior IRFs'; cas = 'Posterior IRFs';

View File

@ -79,7 +79,7 @@ if isempty(ext)
fname = [pathstr, name, '.m']; fname = [pathstr, name, '.m'];
else else
if ~isequal(ext, '.m') if ~isequal(ext, '.m')
error(['The first argument needs to be the name of a matlab script (with an .m extension)!']) error('The first argument needs to be the name of a matlab script (with an .m extension)!')
end end
end end
@ -88,13 +88,13 @@ if ~iscell(c)
end end
if ndims(c)>2 if ndims(c)>2
error(['The cell passed has a second argument cannot have more than two dimensions!']) error('The cell passed has a second argument cannot have more than two dimensions!')
end end
variablename = inputname(2); variablename = inputname(2);
if isempty(variablename) && nargin<3 if isempty(variablename) && nargin<3
error(['You must pass the name of the cell (second input argument) as a string in the third input argument!']) error('You must pass the name of the cell (second input argument) as a string in the third input argument!')
end end
if nargin>2 if nargin>2

View File

@ -81,7 +81,7 @@ UDIAG = zeros(NumberOfLines,6,npar-fpar+1);
if whoiam if whoiam
waitbarString = ['Please wait... MCMC diagnostics (' int2str(fpar) 'of' int2str(npar) ')...']; waitbarString = ['Please wait... MCMC diagnostics (' int2str(fpar) 'of' int2str(npar) ')...'];
if Parallel(ThisMatlab).Local if Parallel(ThisMatlab).Local
waitbarTitle=['Local ']; waitbarTitle='Local ';
else else
waitbarTitle=[Parallel(ThisMatlab).ComputerName]; waitbarTitle=[Parallel(ThisMatlab).ComputerName];
end end

View File

@ -63,7 +63,7 @@ ivar=zeros(n, 1);
for i=1:n for i=1:n
i_tmp = strmatch(var_list{i}, M_.endo_names, 'exact'); i_tmp = strmatch(var_list{i}, M_.endo_names, 'exact');
if isempty(i_tmp) if isempty(i_tmp)
error (['One of the specified variables does not exist']) ; error ('One of the specified variables does not exist') ;
else else
ivar(i) = i_tmp; ivar(i) = i_tmp;
end end

View File

@ -47,7 +47,7 @@ else
end end
if mu<lb if mu<lb
error(['The prior expectation (%f) %scannot be smaller than the lower bound of the Beta distribution (%f)!'], mu, name1, lb) error('The prior expectation (%f) %scannot be smaller than the lower bound of the Beta distribution (%f)!', mu, name1, lb)
end end
if mu>ub if mu>ub

@ -1 +1 @@
Subproject commit 4fceb85e3a1d10e8040b60bcb5cf79a3c533956c Subproject commit c799f003eb8d8ca51ef2926f1e9deec1f80cb5e2

View File

@ -36,9 +36,9 @@ if ~(nargin >= 3)
end end
if options_.smpl == 0 if options_.smpl == 0
k = [1:size(oo_.endo_simul,2)]; k = 1:size(oo_.endo_simul,2);
else else
k = [M_.maximum_lag+options_.smpl(1):M_.maximum_lag+options_.smpl(2)]; k = M_.maximum_lag+options_.smpl(1):M_.maximum_lag+options_.smpl(2);
end end
if nargin == 3 if nargin == 3

View File

@ -69,7 +69,7 @@ else
running_text = varargin{2}; running_text = varargin{2};
end end
if Parallel.Local if Parallel.Local
waitbarTitle=['Local ']; waitbarTitle='Local ';
else else
waitbarTitle=[Parallel.ComputerName]; waitbarTitle=[Parallel.ComputerName];
end end

View File

@ -83,7 +83,7 @@ if isoctave
skipline() skipline()
elseif octave_ver_less_than('7.1.0') % Should match the test in meson.build, and also the one in matlab/modules/dseries/src/initialize_dseries_class.m elseif octave_ver_less_than('7.1.0') % Should match the test in meson.build, and also the one in matlab/modules/dseries/src/initialize_dseries_class.m
skipline() skipline()
warning(['This version of Dynare has only been tested on Octave 7.1.0 and above. Dynare may fail to run or give unexpected result. Consider upgrading your version of Octave.']) warning('This version of Dynare has only been tested on Octave 7.1.0 and above. Dynare may fail to run or give unexpected result. Consider upgrading your version of Octave.')
skipline() skipline()
end end
else else

View File

@ -132,7 +132,7 @@ if ~isempty(endo_prior_restrictions.moment)
for i=1:nvar for i=1:nvar
i_tmp = strmatch(var_list_(i,:), M_.endo_names, 'exact'); i_tmp = strmatch(var_list_(i,:), M_.endo_names, 'exact');
if isempty(i_tmp) if isempty(i_tmp)
error (['One of the variable specified does not exist']) error ('One of the variable specified does not exist')
else else
ivar(i) = i_tmp; ivar(i) = i_tmp;
end end

View File

@ -49,11 +49,11 @@ else
end end
pfm.nd = pfm.nyp+pfm.ny0+pfm.nyf; pfm.nd = pfm.nyp+pfm.ny0+pfm.nyf;
pfm.nrc = pfm.nyf+1; pfm.nrc = pfm.nyf+1;
pfm.isp = [1:pfm.nyp]; pfm.isp = 1:pfm.nyp;
pfm.is = [pfm.nyp+1:pfm.ny+pfm.nyp]; pfm.is = pfm.nyp+1:pfm.ny+pfm.nyp;
pfm.isf = pfm.iyf+pfm.nyp; pfm.isf = pfm.iyf+pfm.nyp;
pfm.isf1 = [pfm.nyp+pfm.ny+1:pfm.nyf+pfm.nyp+pfm.ny+1]; pfm.isf1 = pfm.nyp+pfm.ny+1:pfm.nyf+pfm.nyp+pfm.ny+1;
pfm.iz = [1:pfm.ny+pfm.nyp+pfm.nyf]; pfm.iz = 1:pfm.ny+pfm.nyp+pfm.nyf;
pfm.periods = options_.ep.periods; pfm.periods = options_.ep.periods;
pfm.steady_state = oo_.steady_state; pfm.steady_state = oo_.steady_state;
pfm.params = M_.params; pfm.params = M_.params;

View File

@ -70,8 +70,8 @@ else
end end
if verbose if verbose
disp ([' -----------------------------------------------------']); disp (' -----------------------------------------------------');
disp (['MODEL SIMULATION :']); disp ('MODEL SIMULATION :');
fprintf('\n'); fprintf('\n');
end end

View File

@ -337,7 +337,7 @@ fprintf(fidTeX, ' & \\multicolumn{3}{c}{Prior} & \\multicolumn{4}{c}{Posterio
fprintf(fidTeX, ' \\cmidrule(r{.75em}){2-4} \\cmidrule(r{.75em}){5-8}\n'); fprintf(fidTeX, ' \\cmidrule(r{.75em}){2-4} \\cmidrule(r{.75em}){5-8}\n');
fprintf(fidTeX, ' & Dist. & Mean & Stdev. & Mean & Stdev. & HPD inf & HPD sup\\\\\n'); fprintf(fidTeX, ' & Dist. & Mean & Stdev. & Mean & Stdev. & HPD inf & HPD sup\\\\\n');
fprintf(fidTeX, '\\midrule \\endfirsthead \n'); fprintf(fidTeX, '\\midrule \\endfirsthead \n');
fprintf(fidTeX, ['\\caption{(continued)}\\\\']); fprintf(fidTeX, '\\caption{(continued)}\\\\');
fprintf(fidTeX, '\\toprule \n'); fprintf(fidTeX, '\\toprule \n');
fprintf(fidTeX, ' & \\multicolumn{3}{c}{Prior} & \\multicolumn{4}{c}{Posterior} \\\\\n'); fprintf(fidTeX, ' & \\multicolumn{3}{c}{Prior} & \\multicolumn{4}{c}{Posterior} \\\\\n');
fprintf(fidTeX, ' \\cmidrule(r{.75em}){2-4} \\cmidrule(r{.75em}){5-8}\n'); fprintf(fidTeX, ' \\cmidrule(r{.75em}){2-4} \\cmidrule(r{.75em}){5-8}\n');
@ -349,7 +349,7 @@ fid = fidTeX;
function TeXCore(fid, name, shape, priormean, priorstd, postmean, poststd, hpd) function TeXCore(fid, name, shape, priormean, priorstd, postmean, poststd, hpd)
fprintf(fid,['$%s$ & %s & %7.3f & %6.4f & %7.3f& %6.4f & %7.4f & %7.4f \\\\ \n'],... fprintf(fid,'$%s$ & %s & %7.3f & %6.4f & %7.3f& %6.4f & %7.4f & %7.4f \\\\ \n',...
name, ... name, ...
shape, ... shape, ...
priormean, ... priormean, ...

View File

@ -400,7 +400,7 @@ if ~options_.nograph && ~options_.no_graph.posterior
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s/%s_Bayesian_IRF_%s_%d}\n',options_.figures.textwidth*min(subplotnum/nn,1),DirectoryName,M_.fname,tit{ii},figunumber); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s/%s_Bayesian_IRF_%s_%d}\n',options_.figures.textwidth*min(subplotnum/nn,1),DirectoryName,M_.fname,tit{ii},figunumber);
if options_.relative_irf if options_.relative_irf
fprintf(fidTeX,['\\caption{Bayesian relative IRF.}']); fprintf(fidTeX,'\\caption{Bayesian relative IRF.}');
else else
fprintf(fidTeX,'\\caption{Bayesian IRF: Orthogonalized shock to $%s$.}\n',titTeX{ii}); fprintf(fidTeX,'\\caption{Bayesian IRF: Orthogonalized shock to $%s$.}\n',titTeX{ii});
end end

View File

@ -60,7 +60,7 @@ end
if nargin == 6 if nargin == 6
indx = restrict_columns; indx = restrict_columns;
indx0=find(~ismember([1:np],indx)); indx0=find(~ismember(1:np,indx));
else else
indx=(find(max(abs(T))>=1.e-10)); indx=(find(max(abs(T))>=1.e-10));
indx0=(find(max(abs(T))<1.e-10)); indx0=(find(max(abs(T))<1.e-10));

View File

@ -204,7 +204,7 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
ip = 1; ip = 1;
for i=1:nvx for i=1:nvx
k = estim_params_.var_exo(i,1); k = estim_params_.var_exo(i,1);
fprintf(fidTeX,[ '$%s$ & %4s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n'],... fprintf(fidTeX, '$%s$ & %4s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n',...
M_.exo_names_tex{k},... M_.exo_names_tex{k},...
pnames{bayestopt_.pshape(ip)+1},... pnames{bayestopt_.pshape(ip)+1},...
bayestopt_.p1(ip),... bayestopt_.p1(ip),...
@ -241,7 +241,7 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
for i=1:ncx for i=1:ncx
k1 = estim_params_.corrx(i,1); k1 = estim_params_.corrx(i,1);
k2 = estim_params_.corrx(i,2); k2 = estim_params_.corrx(i,2);
fprintf(fidTeX,[ '$%s$ & %s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n'],... fprintf(fidTeX, '$%s$ & %s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n',...
[M_.exo_names_tex{k1} ',' M_.exo_names_tex{k2}], ... [M_.exo_names_tex{k1} ',' M_.exo_names_tex{k2}], ...
pnames{bayestopt_.pshape(ip)+1}, ... pnames{bayestopt_.pshape(ip)+1}, ...
bayestopt_.p1(ip), ... bayestopt_.p1(ip), ...
@ -294,7 +294,7 @@ elseif all(bayestopt_.pshape == 0) && options_.TeX %% MLE and GMM Latex output
ip = 1; ip = 1;
for i=1:nvx for i=1:nvx
k = estim_params_.var_exo(i,1); k = estim_params_.var_exo(i,1);
fprintf(fidTeX,[ '$%s$ & %8.4f & %7.4f & %7.4f\\\\ \n'], ... fprintf(fidTeX, '$%s$ & %8.4f & %7.4f & %7.4f\\\\ \n', ...
M_.exo_names_tex{k}, ... M_.exo_names_tex{k}, ...
xparam1(ip), ... xparam1(ip), ...
stdh(ip), ... stdh(ip), ...
@ -327,7 +327,7 @@ elseif all(bayestopt_.pshape == 0) && options_.TeX %% MLE and GMM Latex output
for i=1:ncx for i=1:ncx
k1 = estim_params_.corrx(i,1); k1 = estim_params_.corrx(i,1);
k2 = estim_params_.corrx(i,2); k2 = estim_params_.corrx(i,2);
fprintf(fidTeX,[ '$%s$ & %8.4f & %7.4f & %7.4f \\\\ \n'], ... fprintf(fidTeX, '$%s$ & %8.4f & %7.4f & %7.4f \\\\ \n', ...
[M_.exo_names_tex{k1} ',' M_.exo_names_tex{k2}], ... [M_.exo_names_tex{k1} ',' M_.exo_names_tex{k2}], ...
xparam1(ip), ... xparam1(ip), ...
stdh(ip), ... stdh(ip), ...

View File

@ -394,7 +394,7 @@ switch options_.lik_init
end end
catch ME catch ME
disp(ME.message) disp(ME.message)
disp(['dsge_likelihood:: I am not able to solve the Riccati equation, so I switch to lik_init=1!']); disp('dsge_likelihood:: I am not able to solve the Riccati equation, so I switch to lik_init=1!');
options_.lik_init = 1; options_.lik_init = 1;
Pstar=lyapunov_solver(T,R,Q,options_); Pstar=lyapunov_solver(T,R,Q,options_);
end end
@ -886,7 +886,7 @@ if isfield(M_,'filter_initial_state') && ~isempty(M_.filter_initial_state)
elseif ~options_.loglinear && ~options_.logged_steady_state elseif ~options_.loglinear && ~options_.logged_steady_state
a(bayestopt_.mf0(ii)) = eval(M_.filter_initial_state{state_indices(ii),2}) - dr.ys(state_indices(ii)); a(bayestopt_.mf0(ii)) = eval(M_.filter_initial_state{state_indices(ii),2}) - dr.ys(state_indices(ii));
else else
error(['The steady state is logged. This should not happen. Please contact the developers']) error('The steady state is logged. This should not happen. Please contact the developers')
end end
end end
end end

View File

@ -111,7 +111,7 @@ end
% Set options_.lik_init equal to 3 if diffuse filter is used or kalman_algo refers to a diffuse filter algorithm. % Set options_.lik_init equal to 3 if diffuse filter is used or kalman_algo refers to a diffuse filter algorithm.
if isequal(options_.diffuse_filter,1) || (options_.kalman_algo>2) if isequal(options_.diffuse_filter,1) || (options_.kalman_algo>2)
if isequal(options_.lik_init,2) if isequal(options_.lik_init,2)
error(['options diffuse_filter, lik_init and/or kalman_algo have contradictory settings']) error('options diffuse_filter, lik_init and/or kalman_algo have contradictory settings')
else else
options_.lik_init = 3; options_.lik_init = 3;
end end
@ -428,7 +428,7 @@ if info(1)
M_local.params=params; M_local.params=params;
plist = list_of_parameters_calibrated_as_NaN(M_local); plist = list_of_parameters_calibrated_as_NaN(M_local);
if ~isempty(plist) if ~isempty(plist)
message = ['dynare_estimation_init:: Some of the parameters are NaN (' ]; message = 'dynare_estimation_init:: Some of the parameters are NaN (' ;
for i=1:length(plist) for i=1:length(plist)
if i<length(plist) if i<length(plist)
message = [message, plist{i} ', ']; message = [message, plist{i} ', '];
@ -440,7 +440,7 @@ if info(1)
fprintf('%s\n',message) fprintf('%s\n',message)
plist = list_of_parameters_calibrated_as_Inf(M_local); plist = list_of_parameters_calibrated_as_Inf(M_local);
if ~isempty(plist) if ~isempty(plist)
message = ['dynare_estimation_init:: Some of the parameters are Inf (' ]; message = 'dynare_estimation_init:: Some of the parameters are Inf (' ;
for i=1:length(plist) for i=1:length(plist)
if i<size(plist) if i<size(plist)
message = [message, plist{i} ', ']; message = [message, plist{i} ', '];

View File

@ -125,30 +125,30 @@ non_zero_ME=length(estim_params_.H_entries_to_check_for_positive_definiteness);
print_init_check_warning=false; print_init_check_warning=false;
if maximum_number_non_missing_observations>M_.exo_nbr+non_zero_ME if maximum_number_non_missing_observations>M_.exo_nbr+non_zero_ME
error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables!']) error('initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables!')
end end
if init_number_non_missing_observations>M_.exo_nbr+non_zero_ME if init_number_non_missing_observations>M_.exo_nbr+non_zero_ME
if options_.no_init_estimation_check_first_obs if options_.no_init_estimation_check_first_obs
print_init_check_warning=true; print_init_check_warning=true;
else else
error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables in first period!']) error('initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables in first period!')
end end
end end
if options_.heteroskedastic_filter if options_.heteroskedastic_filter
if any(observations_by_period>(non_zero_shocks_by_period+non_zero_ME)) if any(observations_by_period>(non_zero_shocks_by_period+non_zero_ME))
error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance: Check heteroskedastic block and shocks calibration!']) error('initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance: Check heteroskedastic block and shocks calibration!')
end end
else else
if maximum_number_non_missing_observations>length(find(diag(M_.Sigma_e)))+non_zero_ME if maximum_number_non_missing_observations>length(find(diag(M_.Sigma_e)))+non_zero_ME
error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!']) error('initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!')
end end
end end
if init_number_non_missing_observations>length(find(diag(M_.Sigma_e)))+non_zero_ME if init_number_non_missing_observations>length(find(diag(M_.Sigma_e)))+non_zero_ME
if options_.no_init_estimation_check_first_obs if options_.no_init_estimation_check_first_obs
print_init_check_warning=true; print_init_check_warning=true;
else else
error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance in first period!']) error('initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance in first period!')
end end
end end
if print_init_check_warning if print_init_check_warning
@ -158,7 +158,7 @@ if print_init_check_warning
end end
if (any(bayestopt_.pshape >0 ) && options_.mh_replic) && options_.mh_nblck<1 if (any(bayestopt_.pshape >0 ) && options_.mh_replic) && options_.mh_nblck<1
error(['initial_estimation_checks:: Bayesian estimation cannot be conducted with mh_nblocks=0.']) error('initial_estimation_checks:: Bayesian estimation cannot be conducted with mh_nblocks=0.')
end end
% check and display warnings if steady-state solves static model (except if diffuse_filter == 1) and if steady-state changes estimated parameters % check and display warnings if steady-state solves static model (except if diffuse_filter == 1) and if steady-state changes estimated parameters
@ -251,8 +251,8 @@ end
if options_.prefilter==1 if options_.prefilter==1
if (~options_.loglinear && any(abs(oo_.steady_state(bayestopt_.mfys))>1e-9)) || (options_.loglinear && any(abs(log(oo_.steady_state(bayestopt_.mfys)))>1e-9)) if (~options_.loglinear && any(abs(oo_.steady_state(bayestopt_.mfys))>1e-9)) || (options_.loglinear && any(abs(log(oo_.steady_state(bayestopt_.mfys)))>1e-9))
disp(['You are trying to estimate a model with a non zero steady state for the observed endogenous']) disp('You are trying to estimate a model with a non zero steady state for the observed endogenous')
disp(['variables using demeaned data!']) disp('variables using demeaned data!')
error('You should change something in your mod file...') error('You should change something in your mod file...')
end end
end end

View File

@ -91,14 +91,14 @@ for i=1:NumberOfModels
catch catch
if strcmpi(type,'LaplaceApproximation') if strcmpi(type,'LaplaceApproximation')
if isfield(mstruct.oo_,'mle_mode') if isfield(mstruct.oo_,'mle_mode')
disp(['MODEL_COMPARISON: Model comparison is a Bayesian approach and does not support models estimated with ML']) disp('MODEL_COMPARISON: Model comparison is a Bayesian approach and does not support models estimated with ML')
else else
disp(['MODEL_COMPARISON: I cant''t find the Laplace approximation associated to model ' ModelNames{i}]) disp(['MODEL_COMPARISON: I cant''t find the Laplace approximation associated to model ' ModelNames{i}])
end end
return return
elseif strcmpi(type,'ModifiedHarmonicMean') elseif strcmpi(type,'ModifiedHarmonicMean')
if isfield(mstruct.oo_,'mle_mode') if isfield(mstruct.oo_,'mle_mode')
disp(['MODEL_COMPARISON: Model comparison is a Bayesian approach and does not support models estimated with ML']) disp('MODEL_COMPARISON: Model comparison is a Bayesian approach and does not support models estimated with ML')
else else
disp(['MODEL_COMPARISON: I cant''t find the modified harmonic mean estimate associated to model ' ModelNames{i}]) disp(['MODEL_COMPARISON: I cant''t find the modified harmonic mean estimate associated to model ' ModelNames{i}])
end end

View File

@ -155,7 +155,7 @@ elseif filter_covar_indicator
hpd_interval=NaN([size_matrix(1:3),2]); hpd_interval=NaN([size_matrix(1:3),2]);
end end
if size(stock1_filter_covar,draw_dimension)>9 if size(stock1_filter_covar,draw_dimension)>9
post_deciles =quantile(stock1_filter_covar,[0.1:0.1:0.9],draw_dimension); post_deciles =quantile(stock1_filter_covar,0.1:0.1:0.9,draw_dimension);
else else
size_matrix=size(stock1_filter_covar); size_matrix=size(stock1_filter_covar);
post_deciles=NaN([size_matrix(1:3),9]); post_deciles=NaN([size_matrix(1:3),9]);
@ -177,7 +177,7 @@ elseif state_uncert_indicator
hpd_interval=NaN([size_matrix(1:3),2]); hpd_interval=NaN([size_matrix(1:3),2]);
end end
if size(stock1_state_uncert,draw_dimension)>9 if size(stock1_state_uncert,draw_dimension)>9
post_deciles =quantile(stock1_state_uncert,[0.1:0.1:0.9],draw_dimension); post_deciles =quantile(stock1_state_uncert,0.1:0.1:0.9,draw_dimension);
else else
size_matrix=size(stock1_state_uncert); size_matrix=size(stock1_state_uncert);
post_deciles=NaN([size_matrix(1:3),9]); post_deciles=NaN([size_matrix(1:3),9]);

View File

@ -38,7 +38,7 @@ switch info
nvar = length(ivar); nvar = length(ivar);
oo_ = job(type,SampleSize,arg1,arg2,arg3,options_,M_,oo_,nvar,vartan); oo_ = job(type,SampleSize,arg1,arg2,arg3,options_,M_,oo_,nvar,vartan);
otherwise otherwise
error(['posterior_analysis:: Check_posterior_analysis_data gave a meaningless output!']) error('posterior_analysis:: Check_posterior_analysis_data gave a meaningless output!')
end end

View File

@ -227,23 +227,23 @@ for curr_block = fblck:nblck
end end
save([BaseName '_mh' int2str(NewFile(curr_block)) '_blck' int2str(curr_block) '.mat'],'x2','logpo2','LastSeeds','accepted_draws_this_chain','accepted_draws_this_file','feval_this_chain','feval_this_file'); save([BaseName '_mh' int2str(NewFile(curr_block)) '_blck' int2str(curr_block) '.mat'],'x2','logpo2','LastSeeds','accepted_draws_this_chain','accepted_draws_this_file','feval_this_chain','feval_this_file');
fidlog = fopen([MetropolisFolder '/metropolis.log'],'a'); fidlog = fopen([MetropolisFolder '/metropolis.log'],'a');
fprintf(fidlog,['\n']); fprintf(fidlog,'\n');
fprintf(fidlog,['%% Mh' int2str(NewFile(curr_block)) 'Blck' int2str(curr_block) ' (' datestr(now,0) ')\n']); fprintf(fidlog,['%% Mh' int2str(NewFile(curr_block)) 'Blck' int2str(curr_block) ' (' datestr(now,0) ')\n']);
fprintf(fidlog,' \n'); fprintf(fidlog,' \n');
fprintf(fidlog,[' Number of simulations.: ' int2str(length(logpo2)) '\n']); fprintf(fidlog,[' Number of simulations.: ' int2str(length(logpo2)) '\n']);
fprintf(fidlog,[' Acceptance ratio......: ' num2str(accepted_draws_this_file/length(logpo2)) '\n']); fprintf(fidlog,[' Acceptance ratio......: ' num2str(accepted_draws_this_file/length(logpo2)) '\n']);
fprintf(fidlog,[' Feval per iteration...: ' num2str(feval_this_file/length(logpo2)) '\n']); fprintf(fidlog,[' Feval per iteration...: ' num2str(feval_this_file/length(logpo2)) '\n']);
fprintf(fidlog,[' Posterior mean........:\n']); fprintf(fidlog,' Posterior mean........:\n');
for i=1:length(x2(1,:)) for i=1:length(x2(1,:))
fprintf(fidlog,[' params:' int2str(i) ': ' num2str(mean(x2(:,i))) '\n']); fprintf(fidlog,[' params:' int2str(i) ': ' num2str(mean(x2(:,i))) '\n']);
end end
fprintf(fidlog,[' log2po:' num2str(mean(logpo2)) '\n']); fprintf(fidlog,[' log2po:' num2str(mean(logpo2)) '\n']);
fprintf(fidlog,[' Minimum value.........:\n']); fprintf(fidlog,' Minimum value.........:\n');
for i=1:length(x2(1,:)) for i=1:length(x2(1,:))
fprintf(fidlog,[' params:' int2str(i) ': ' num2str(min(x2(:,i))) '\n']); fprintf(fidlog,[' params:' int2str(i) ': ' num2str(min(x2(:,i))) '\n']);
end end
fprintf(fidlog,[' log2po:' num2str(min(logpo2)) '\n']); fprintf(fidlog,[' log2po:' num2str(min(logpo2)) '\n']);
fprintf(fidlog,[' Maximum value.........:\n']); fprintf(fidlog,' Maximum value.........:\n');
for i=1:length(x2(1,:)) for i=1:length(x2(1,:))
fprintf(fidlog,[' params:' int2str(i) ': ' num2str(max(x2(:,i))) '\n']); fprintf(fidlog,[' params:' int2str(i) ': ' num2str(max(x2(:,i))) '\n']);
end end

View File

@ -182,7 +182,7 @@ if ~options_.load_mh_file && ~options_.mh_recover
% Find initial values for the NumberOfBlocks chains... % Find initial values for the NumberOfBlocks chains...
if NumberOfBlocks > 1 || options_.mh_initialize_from_previous_mcmc.status% Case 1: multiple chains if NumberOfBlocks > 1 || options_.mh_initialize_from_previous_mcmc.status% Case 1: multiple chains
options_=set_dynare_seed_local_options(options_,'default'); options_=set_dynare_seed_local_options(options_,'default');
fprintf(fidlog,[' Initial values of the parameters:\n']); fprintf(fidlog,' Initial values of the parameters:\n');
fprintf('%s: Searching for initial values...\n', dispString); fprintf('%s: Searching for initial values...\n', dispString);
if ~options_.mh_initialize_from_previous_mcmc.status if ~options_.mh_initialize_from_previous_mcmc.status
ix2 = zeros(NumberOfBlocks,npar); ix2 = zeros(NumberOfBlocks,npar);
@ -253,7 +253,7 @@ if ~options_.load_mh_file && ~options_.mh_recover
fprintf(fidlog,' \n'); fprintf(fidlog,' \n');
fprintf('%s: Initial values found!\n\n',dispString); fprintf('%s: Initial values found!\n\n',dispString);
else% Case 2: one chain (we start from the posterior mode) else% Case 2: one chain (we start from the posterior mode)
fprintf(fidlog,[' Initial values of the parameters:\n']); fprintf(fidlog,' Initial values of the parameters:\n');
candidate = transpose(xparam1(:));% candidate = transpose(xparam1(:));%
if all(candidate(:) >= mh_bounds.lb) && all(candidate(:) <= mh_bounds.ub) if all(candidate(:) >= mh_bounds.lb) && all(candidate(:) <= mh_bounds.ub)
ix2 = candidate; ix2 = candidate;
@ -313,10 +313,10 @@ if ~options_.load_mh_file && ~options_.mh_recover
fprintf('Ok!\n'); fprintf('Ok!\n');
id = write_mh_history_file(MetropolisFolder, ModelName, record); id = write_mh_history_file(MetropolisFolder, ModelName, record);
fprintf('%s: Details about the MCMC are available in %s_mh_history_%u.mat\n\n', dispString,BaseName,id); fprintf('%s: Details about the MCMC are available in %s_mh_history_%u.mat\n\n', dispString,BaseName,id);
fprintf(fidlog,[' CREATION OF THE MH HISTORY FILE!\n\n']); fprintf(fidlog,' CREATION OF THE MH HISTORY FILE!\n\n');
fprintf(fidlog,[' Expected number of files per block.......: ' int2str(AnticipatedNumberOfFiles) '.\n']); fprintf(fidlog,[' Expected number of files per block.......: ' int2str(AnticipatedNumberOfFiles) '.\n']);
fprintf(fidlog,[' Expected number of lines in the last file: ' int2str(AnticipatedNumberOfLinesInTheLastFile) '.\n']); fprintf(fidlog,[' Expected number of lines in the last file: ' int2str(AnticipatedNumberOfLinesInTheLastFile) '.\n']);
fprintf(fidlog,['\n']); fprintf(fidlog,'\n');
for j = 1:NumberOfBlocks for j = 1:NumberOfBlocks
fprintf(fidlog,[' Initial state of the Gaussian random number generator for chain number ',int2str(j),':\n']); fprintf(fidlog,[' Initial state of the Gaussian random number generator for chain number ',int2str(j),':\n']);
for i=1:length(record.InitialSeeds(j).Normal) for i=1:length(record.InitialSeeds(j).Normal)

View File

@ -142,7 +142,7 @@ skipline(2)
function format_string = build_format_string(PriorMode,PriorStandardDeviation,LowerBound,UpperBound) function format_string = build_format_string(PriorMode,PriorStandardDeviation,LowerBound,UpperBound)
format_string = ['%s \t %6.4f \t']; format_string = '%s \t %6.4f \t';
if isnan(PriorMode) if isnan(PriorMode)
format_string = [ format_string , ' %s \t']; format_string = [ format_string , ' %s \t'];
else else

View File

@ -38,7 +38,7 @@ switch info
nvar = length(ivar); nvar = length(ivar);
oo_ = job(type,SampleSize,arg1,arg2,arg3,options_,M_,oo_,nvar,vartan); oo_ = job(type,SampleSize,arg1,arg2,arg3,options_,M_,oo_,nvar,vartan);
otherwise otherwise
error(['prior_analysis:: Check_prior_analysis_data gave a meaningless output!']) error('prior_analysis:: Check_prior_analysis_data gave a meaningless output!')
end end

View File

@ -352,7 +352,7 @@ for b=fpar:B
stock_forcst_point(:,:,irun(7)) = yf1(maxlag+1:end,:)'; stock_forcst_point(:,:,irun(7)) = yf1(maxlag+1:end,:)';
if ~isequal(M_.H,0) if ~isequal(M_.H,0)
ME_shocks=zeros(length(varobs),horizon); ME_shocks=zeros(length(varobs),horizon);
i_exo_var = setdiff([1:length(varobs)],find(diag(M_.H) == 0)); i_exo_var = setdiff(1:length(varobs),find(diag(M_.H) == 0));
nxs = length(i_exo_var); nxs = length(i_exo_var);
chol_H = chol(M_.H(i_exo_var,i_exo_var)); chol_H = chol(M_.H(i_exo_var,i_exo_var));
if ~isempty(M_.H) if ~isempty(M_.H)

View File

@ -63,7 +63,7 @@ switch nargin
end end
drawsize = drsize+npar*8/1048576; drawsize = drsize+npar*8/1048576;
otherwise otherwise
error(['selec_posterior_draws:: Unexpected number of input arguments!']) error('selec_posterior_draws:: Unexpected number of input arguments!')
end end
MetropolisFolder = CheckPath('metropolis',M_.dname); MetropolisFolder = CheckPath('metropolis',M_.dname);

View File

@ -99,7 +99,7 @@ for l=1:npar
name = get_the_name(l,TeX,M_,estim_params_,options_.varobs); name = get_the_name(l,TeX,M_,estim_params_,options_.varobs);
str = sprintf('%s\n %s \t\t %5.4f \t\t %7.5f \t\t %5.4f', str, name, lb95_xparam(l), mean_xparam(l), ub95_xparam(l)); str = sprintf('%s\n %s \t\t %5.4f \t\t %7.5f \t\t %5.4f', str, name, lb95_xparam(l), mean_xparam(l), ub95_xparam(l));
end end
disp([str]) disp(str)
disp('') disp('')
%% Plot parameters densities %% Plot parameters densities

View File

@ -53,7 +53,7 @@ if ~options_.bytecode && options_.block && options_.solve_algo == 5
end end
if isoctave && options_.solve_algo == 11 if isoctave && options_.solve_algo == 11
error(['STEADY: you can''t use solve_algo = %u under Octave'],options_.solve_algo) error('STEADY: you can''t use solve_algo = %u under Octave',options_.solve_algo)
end end
% To ensure that the z and zx matrices constructed by repmat and passed to bytecode % To ensure that the z and zx matrices constructed by repmat and passed to bytecode

View File

@ -78,7 +78,7 @@ hessian_mat = zeros(size(f0,1), n*n);
for i=1:n for i=1:n
if i > 1 if i > 1
%fill symmetric part of Hessian based on previously computed results %fill symmetric part of Hessian based on previously computed results
k = [i:n:n*(i-1)]; k = i:n:n*(i-1);
hessian_mat(:,(i-1)*n+1:(i-1)*n+i-1) = hessian_mat(:,k); hessian_mat(:,(i-1)*n+1:(i-1)*n+i-1) = hessian_mat(:,k);
end end
hessian_mat(:,(i-1)*n+i) = (f1(:,i)+f_1(:,i)-2*f0)./(h1(i)*h_1(i)); %formula 25.3.23 hessian_mat(:,(i-1)*n+i) = (f1(:,i)+f_1(:,i)-2*f0)./(h1(i)*h_1(i)); %formula 25.3.23

View File

@ -130,7 +130,7 @@ if strcmpi(flag,'--load-mh-history') || strcmpi(flag,'--display-mh-history')
disp([' o Acceptance ratio in the current chain is ' num2str(oar(b)*100,'%5.2f') '%']); disp([' o Acceptance ratio in the current chain is ' num2str(oar(b)*100,'%5.2f') '%']);
disp([' o Initial value of the posterior kernel is: ' num2str(oo.InitialLogPost(b),'%10.5f')]) disp([' o Initial value of the posterior kernel is: ' num2str(oo.InitialLogPost(b),'%10.5f')])
disp([' o Last value of the posterior kernel is: ' num2str(o.LastLogPost(b),'%10.5f')]) disp([' o Last value of the posterior kernel is: ' num2str(o.LastLogPost(b),'%10.5f')])
disp([' o State of the chain:']) disp(' o State of the chain:')
skipline() skipline()
d1 = num2str(transpose(oo.InitialParameters(b,:)),'%10.5f\n'); d1 = num2str(transpose(oo.InitialParameters(b,:)),'%10.5f\n');
d2 = num2str(transpose(o.LastParameters(b,:)),'%10.5f\n'); d2 = num2str(transpose(o.LastParameters(b,:)),'%10.5f\n');

View File

@ -699,7 +699,7 @@ if isfield(M_,'filter_initial_state') && ~isempty(M_.filter_initial_state)
elseif ~options_.loglinear && ~options_.logged_steady_state elseif ~options_.loglinear && ~options_.logged_steady_state
a(oo_.dr.restrict_columns(ii)) = eval(M_.filter_initial_state{state_indices(ii),2}) - oo_.dr.ys(state_indices(ii)); a(oo_.dr.restrict_columns(ii)) = eval(M_.filter_initial_state{state_indices(ii),2}) - oo_.dr.ys(state_indices(ii));
else else
error(['The steady state is logged. This should not happen. Please contact the developers']) error('The steady state is logged. This should not happen. Please contact the developers')
end end
end end
end end

View File

@ -123,7 +123,7 @@ while rank(Z*Pinf*Z',diffuse_kalman_tol) && (t<=last)
end end
if t>last if t>last
warning(['kalman_filter_d: There isn''t enough information to estimate the initial conditions of the nonstationary variables. The diffuse Kalman filter never left the diffuse stage.']); warning('kalman_filter_d: There isn''t enough information to estimate the initial conditions of the nonstationary variables. The diffuse Kalman filter never left the diffuse stage.');
dLIK = NaN; dLIK = NaN;
return return
end end

View File

@ -134,7 +134,7 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
end end
if t==(last+1) if t==(last+1)
warning(['kalman_filter_d: There isn''t enough information to estimate the initial conditions of the nonstationary variables. The diffuse Kalman filter never left the diffuse stage.']); warning('kalman_filter_d: There isn''t enough information to estimate the initial conditions of the nonstationary variables. The diffuse Kalman filter never left the diffuse stage.');
dLIK = NaN; dLIK = NaN;
return return
end end

View File

@ -181,7 +181,7 @@ while newRank && (t<=last)
end end
if (t>last) if (t>last)
warning(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']); warning('univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables');
dLIK = NaN; dLIK = NaN;
return return
end end

View File

@ -815,6 +815,6 @@ epsilonhat = Y - Z*alphahat;
if (d==smpl) if (d==smpl)
warning(['missing_DiffuseKalmanSmootherH3_Z:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']); warning('missing_DiffuseKalmanSmootherH3_Z:: There isn''t enough information to estimate the initial conditions of the nonstationary variables');
return return
end end

View File

@ -48,7 +48,7 @@ if Long_names_present==1
else else
fprintf(fid, '\\begin{longtable}{cc}\n'); fprintf(fid, '\\begin{longtable}{cc}\n');
end end
fprintf(fid, ['\\caption{Parameter Values}\\\\%%\n']); fprintf(fid, '\\caption{Parameter Values}\\\\%%\n');
fprintf(fid, '\\toprule%%\n'); fprintf(fid, '\\toprule%%\n');
fprintf(fid, '\\multicolumn{1}{c}{\\textbf{Parameter}} &\n'); fprintf(fid, '\\multicolumn{1}{c}{\\textbf{Parameter}} &\n');

View File

@ -175,7 +175,7 @@ fprintf(fidTeX,'%% End of TeX file.\n');
fclose(fidTeX); fclose(fidTeX);
function format_string = build_format_string(PriorMode,PriorStandardDeviation,LowerBound,UpperBound) function format_string = build_format_string(PriorMode,PriorStandardDeviation,LowerBound,UpperBound)
format_string = ['%s & %s & %6.4f &']; format_string = '%s & %s & %6.4f &';
if isnan(PriorMode) if isnan(PriorMode)
format_string = [ format_string , ' %s &']; format_string = [ format_string , ' %s &'];
else else

View File

@ -35,12 +35,12 @@ iyf = find(lead_lag_incidence(3,:)>0) ;
nd = nyp+ny0+nyf; nd = nyp+ny0+nyf;
nrc = nyf+1 ; nrc = nyf+1 ;
isp = [1:nyp] ; isp = 1:nyp ;
is = [nyp+1:ny+nyp] ; is = nyp+1:ny+nyp ;
isf = iyf+nyp ; isf = iyf+nyp ;
isf1 = [nyp+ny+1:nyf+nyp+ny+1] ; isf1 = nyp+ny+1:nyf+nyp+ny+1 ;
stop = 0 ; stop = 0 ;
iz = [1:ny+nyp+nyf]; iz = 1:ny+nyp+nyf;
periods = options.periods; periods = options.periods;
steady_state = oo_.steady_state; steady_state = oo_.steady_state;

View File

@ -34,7 +34,7 @@ else
try try
data_mat=[data_mat vec(data_file.(varobs{var_iter}))]; data_mat=[data_mat vec(data_file.(varobs{var_iter}))];
catch catch
error(['makedataset: The variable %s does not have dimensions conformable with the previous one'], varobs{var_iter}); error('makedataset: The variable %s does not have dimensions conformable with the previous one', varobs{var_iter});
end end
end end
end end

View File

@ -59,19 +59,19 @@ problem_dummy=0;
%naming conflict in steady state file %naming conflict in steady state file
if options_.steadystate_flag == 1 if options_.steadystate_flag == 1
if strmatch('ys',M_.endo_names,'exact') if strmatch('ys',M_.endo_names,'exact')
disp(['MODEL_DIAGNOSTICS: using the name ys for an endogenous variable will typically conflict with the internal naming in user-defined steady state files.']) disp('MODEL_DIAGNOSTICS: using the name ys for an endogenous variable will typically conflict with the internal naming in user-defined steady state files.')
problem_dummy=1; problem_dummy=1;
end end
if strmatch('ys',M_.param_names,'exact') if strmatch('ys',M_.param_names,'exact')
disp(['MODEL_DIAGNOSTICS: using the name ys for a parameter will typically conflict with the internal naming in user-defined steady state files.']) disp('MODEL_DIAGNOSTICS: using the name ys for a parameter will typically conflict with the internal naming in user-defined steady state files.')
problem_dummy=1; problem_dummy=1;
end end
if strmatch('M_',M_.endo_names,'exact') if strmatch('M_',M_.endo_names,'exact')
disp(['MODEL_DIAGNOSTICS: using the name M_ for an endogenous variable will typically conflict with the internal naming in user-defined steady state files.']) disp('MODEL_DIAGNOSTICS: using the name M_ for an endogenous variable will typically conflict with the internal naming in user-defined steady state files.')
problem_dummy=1; problem_dummy=1;
end end
if strmatch('M_',M_.param_names,'exact') if strmatch('M_',M_.param_names,'exact')
disp(['MODEL_DIAGNOSTICS: using the name M_ for a parameter will typically conflict with the internal naming in user-defined steady state files.']) disp('MODEL_DIAGNOSTICS: using the name M_ for a parameter will typically conflict with the internal naming in user-defined steady state files.')
problem_dummy=1; problem_dummy=1;
end end
end end
@ -124,10 +124,10 @@ if check1(1)
problem_dummy=1; problem_dummy=1;
disp('MODEL_DIAGNOSTICS: The steady state cannot be computed') disp('MODEL_DIAGNOSTICS: The steady state cannot be computed')
if any(isnan(dr.ys)) if any(isnan(dr.ys))
disp(['MODEL_DIAGNOSTICS: Steady state contains NaNs']) disp('MODEL_DIAGNOSTICS: Steady state contains NaNs')
end end
if any(isinf(dr.ys)) if any(isinf(dr.ys))
disp(['MODEL_DIAGNOSTICS: Steady state contains Inf']) disp('MODEL_DIAGNOSTICS: Steady state contains Inf')
end end
return return
end end

View File

@ -58,7 +58,7 @@ ivar=zeros(nvar,1);
for i=1:nvar for i=1:nvar
i_tmp = strmatch(var_list{i}, M_.endo_names, 'exact'); i_tmp = strmatch(var_list{i}, M_.endo_names, 'exact');
if isempty(i_tmp) if isempty(i_tmp)
error (['One of the variables specified does not exist']) ; error ('One of the variables specified does not exist') ;
else else
ivar(i) = i_tmp; ivar(i) = i_tmp;
end end
@ -70,9 +70,9 @@ nspred = M_.nspred;
nstatic = M_.nstatic; nstatic = M_.nstatic;
kstate = oo_.dr.kstate; kstate = oo_.dr.kstate;
order = oo_.dr.order_var; order = oo_.dr.order_var;
iv(order) = [1:length(order)]; iv(order) = 1:length(order);
nx = size(ghx,2); nx = size(ghx,2);
ikx = [nstatic+1:nstatic+nspred]; ikx = nstatic+1:nstatic+nspred;
k0 = kstate(find(kstate(:,2) <= M_.maximum_lag+1),:); k0 = kstate(find(kstate(:,2) <= M_.maximum_lag+1),:);
i0 = find(k0(:,2) == M_.maximum_lag+1); i0 = find(k0(:,2) == M_.maximum_lag+1);
i00 = i0; i00 = i0;

View File

@ -302,6 +302,6 @@ if options_.order==1
end end
end end
else else
fprintf(['Estimation::compute_moments_varendo: (conditional) variance decomposition only available at order=1. Skipping computations\n']) fprintf('Estimation::compute_moments_varendo: (conditional) variance decomposition only available at order=1. Skipping computations\n')
end end
fprintf('Done!\n\n'); fprintf('Done!\n\n');

View File

@ -58,7 +58,7 @@ if ~all(M_.H==0)
end end
if ~isempty(observable_pos_requested_vars) if ~isempty(observable_pos_requested_vars)
ME_present=1; ME_present=1;
i_ME = setdiff([1:size(M_.H,1)],find(diag(M_.H) == 0)); % find ME with 0 variance i_ME = setdiff(1:size(M_.H,1),find(diag(M_.H) == 0)); % find ME with 0 variance
chol_S = chol(M_.H(i_ME,i_ME)); %decompose rest chol_S = chol(M_.H(i_ME,i_ME)); %decompose rest
shock_mat=zeros(options_.periods,size(M_.H,1)); %initialize shock_mat=zeros(options_.periods,size(M_.H,1)); %initialize
shock_mat(:,i_ME)=randn(length(i_ME),options_.periods)'*chol_S; shock_mat(:,i_ME)=randn(length(i_ME),options_.periods)'*chol_S;
@ -173,7 +173,7 @@ if ~options_.nodecomposition
end end
end end
%back out shock matrix used for generating y %back out shock matrix used for generating y
i_exo_var = setdiff([1:M_.exo_nbr],find(diag(M_.Sigma_e) == 0)); % find shocks with 0 variance i_exo_var = setdiff(1:M_.exo_nbr,find(diag(M_.Sigma_e) == 0)); % find shocks with 0 variance
chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var)); %decompose rest chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var)); %decompose rest
shock_mat=zeros(options_.periods,M_.exo_nbr); %initialize shock_mat=zeros(options_.periods,M_.exo_nbr); %initialize
shock_mat(:,i_exo_var)=oo_.exo_simul(:,i_exo_var)/chol_S; %invert construction of oo_.exo_simul from simult.m shock_mat(:,i_exo_var)=oo_.exo_simul(:,i_exo_var)/chol_S; %invert construction of oo_.exo_simul from simult.m

View File

@ -43,7 +43,7 @@ function oo_=disp_th_moments_pruned_state_space(dr,M_,options_,i_var,oo_)
if options_.one_sided_hp_filter || options_.hp_filter || options_.bandpass.indicator if options_.one_sided_hp_filter || options_.hp_filter || options_.bandpass.indicator
error(['disp_th_moments:: theoretical moments incompatible with filtering. Use simulated moments instead']) error('disp_th_moments:: theoretical moments incompatible with filtering. Use simulated moments instead')
end end
nvars=length(i_var); nvars=length(i_var);

View File

@ -121,7 +121,7 @@ vlog_a0_Yao = zeros(nvar,1);
vlog=zeros(ndraws2,1); vlog=zeros(ndraws2,1);
for k=1:nvar for k=1:nvar
bk = Uiconst{k}'*A0xhat(:,k); bk = Uiconst{k}'*A0xhat(:,k);
indx_ks=[k:nvar]; % the columns that exclude 1-(k-1)th columns indx_ks=k:nvar; % the columns that exclude 1-(k-1)th columns
A0gbs0 = A0hat; % starting at some point such as the peak A0gbs0 = A0hat; % starting at some point such as the peak
nk = n0(k); nk = n0(k);

View File

@ -64,7 +64,7 @@ for i_chain = 1:n_chains
%//== column of the transition matrix. Each element must be positive. For each column, %//== column of the transition matrix. Each element must be positive. For each column,
%//== the relative size of the prior elements determine the relative size of the elements %//== the relative size of the prior elements determine the relative size of the elements
%//== of the transition matrix and overall larger sizes implies a tighter prior. %//== of the transition matrix and overall larger sizes implies a tighter prior.
fprintf(fh,['//== Transition matrix prior for state_variable[%d] ==//\n'], ... fprintf(fh,'//== Transition matrix prior for state_variable[%d] ==//\n', ...
i_chain); i_chain);
Alpha = ones(n_states,n_states); Alpha = ones(n_states,n_states);
for i_state = 1:n_states for i_state = 1:n_states

View File

@ -289,7 +289,7 @@ if options_.ms.indxestima
% - 0.01 (or any number < 1) is used so that qmStart+options_.ms.nlags -options_.ms.dummy_obs ==-?*options_.ms.freq give us an extra year back. % - 0.01 (or any number < 1) is used so that qmStart+options_.ms.nlags -options_.ms.dummy_obs ==-?*options_.ms.freq give us an extra year back.
end end
end end
dateswd = fn_dataext([yrStartEsti qmStartEsti],[yrEnd qmEnd],xdatae(:,[1:2])); % dates with dummies dateswd = fn_dataext([yrStartEsti qmStartEsti],[yrEnd qmEnd],xdatae(:,1:2)); % dates with dummies
phie = [dateswd phi]; phie = [dateswd phi];
ye = [dateswd y]; ye = [dateswd y];
@ -484,8 +484,8 @@ if options_.ms.indxestima
% only actual growth rates % only actual growth rates
yafyrghate yafyrghate
if options_.ms.indxgforhat if options_.ms.indxgforhat
keyindx = [1:nvar]; keyindx = 1:nvar;
conlab=['unconditional']; conlab='unconditional';
figure figure
yafyrghate(:,3:end) = yafyrghate(:,3:end)/100; yafyrghate(:,3:end) = yafyrghate(:,3:end)/100;
@ -680,9 +680,9 @@ if options_.ms.indxestima
[yacyrghate,yacyrhate,yacqmyghate] = fn_datana(yachate,options_.ms.freq,options_.ms.log_var(1:nlogeno),options_.ms.percent_var(1:npereno)); [yacyrghate,yacyrhate,yacqmyghate] = fn_datana(yachate,options_.ms.freq,options_.ms.log_var(1:nlogeno),options_.ms.percent_var(1:npereno));
% actual and conditional forecast growth rates % actual and conditional forecast growth rates
if options_.ms.indxgdls && nconstr if options_.ms.indxgdls && nconstr
keyindx = [1:nvar]; keyindx = 1:nvar;
% conlab=['conditional on' ylab{PorR(1)}]; % conlab=['conditional on' ylab{PorR(1)}];
conlab=['v-conditions']; conlab='v-conditions';
figure figure
fn_foregraph(yafyrghate,yact2yrge,keyindx,rnum,cnum,options_.ms.freq,ylab,forelabel,conlab) fn_foregraph(yafyrghate,yact2yrge,keyindx,rnum,cnum,options_.ms.freq,ylab,forelabel,conlab)
@ -713,9 +713,9 @@ if options_.ms.indxestima
disp([sprintf('%4.0f %2.0f %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n',yacEyrghate')]) disp([sprintf('%4.0f %2.0f %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n',yacEyrghate')])
if 1 if 1
keyindx = [1:nvar]; keyindx = 1:nvar;
% conlab=['conditional on' ylab{PorR(1)}]; % conlab=['conditional on' ylab{PorR(1)}];
conlab=['shock-conditions']; conlab='shock-conditions';
figure figure
gyrfore(yacEyrghate,yact2yrge,keyindx,rnum,cnum,ylab,forelabel,conlab) gyrfore(yacEyrghate,yact2yrge,keyindx,rnum,cnum,ylab,forelabel,conlab)
@ -733,7 +733,7 @@ if options_.ms.indxestima
qmStartWod = options_.ms.freq; qmStartWod = options_.ms.freq;
end end
yrStartWod = yrStart + floor((qmStart+options_.ms.nlags -1)/options_.ms.freq); yrStartWod = yrStart + floor((qmStart+options_.ms.nlags -1)/options_.ms.freq);
dateswod = fn_dataext([yrStartWod qmStartWod],[yrEnd qmEnd],xdatae(:,[1:2])); dateswod = fn_dataext([yrStartWod qmStartWod],[yrEnd qmEnd],xdatae(:,1:2));
eplhate = [dateswod eplhat]; eplhate = [dateswod eplhat];
Aphat = Fhat; Aphat = Fhat;

View File

@ -48,7 +48,7 @@ end
%1 CBO output gap -- log(x_t)-log(x_t potential) %1 CBO output gap -- log(x_t)-log(x_t potential)
%2 GDP deflator -- (P_t/P_{t-1})^4-1.0 %2 GDP deflator -- (P_t/P_{t-1})^4-1.0
%2 FFR/100. %2 FFR/100.
options_.ms.vlist = [1:length(options_.varobs)]; % 1: U; 4: PCE inflation. options_.ms.vlist = 1:length(options_.varobs); % 1: U; 4: PCE inflation.
options_.ms.varlist=cellstr(options_.varobs'); options_.ms.varlist=cellstr(options_.varobs');
options_.ms.log_var = sort(varlist_indices(options_.ms.vlistlog,char(options_.varobs))); % subset of "options_.ms.vlist. Variables in log level so that differences are in **monthly** growth, unlike R and U which are in annual percent (divided by 100 already). options_.ms.log_var = sort(varlist_indices(options_.ms.vlistlog,char(options_.varobs))); % subset of "options_.ms.vlist. Variables in log level so that differences are in **monthly** growth, unlike R and U which are in annual percent (divided by 100 already).
options_.ms.percent_var =setdiff(options_.ms.vlist,options_.ms.log_var); options_.ms.percent_var =setdiff(options_.ms.vlist,options_.ms.log_var);

View File

@ -83,7 +83,7 @@ for i=1:nvars
series_names{i} = endo_names{i}; series_names{i} = endo_names{i};
end end
x = [1:T]; x = 1:T;
plot_dates = 0; plot_dates = 0;
data = 0; data = 0;
steady = 0; steady = 0;

View File

@ -80,7 +80,7 @@ if strcmpi(type,'StructuralShock')
end end
end end
catch catch
disp(['Off diagonal terms of the covariance matrix are not estimated (state equation)']) disp('Off diagonal terms of the covariance matrix are not estimated (state equation)')
end end
end end
end end

View File

@ -309,7 +309,7 @@ else
ysteady = [ys(oo_.dr.order_var); U/(1-beta)]; ysteady = [ys(oo_.dr.order_var); U/(1-beta)];
% Generates the sequence of shocks to compute unconditional welfare % Generates the sequence of shocks to compute unconditional welfare
i_exo_var = setdiff([1:M_.exo_nbr],find(diag(M_.Sigma_e) == 0)); i_exo_var = setdiff(1:M_.exo_nbr,find(diag(M_.Sigma_e) == 0));
nxs = length(i_exo_var); nxs = length(i_exo_var);
chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var)); chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var));
exo_simul = zeros(M_.exo_nbr,options_.ramsey.periods); exo_simul = zeros(M_.exo_nbr,options_.ramsey.periods);
@ -397,7 +397,7 @@ if ~isempty(M_.det_shocks)
end end
shock_indices=find(periods==1); shock_indices=find(periods==1);
if any(cellfun(@(x) ~strcmp(x, 'level'), { M_.det_shocks(shock_indices).type })) if any(cellfun(@(x) ~strcmp(x, 'level'), { M_.det_shocks(shock_indices).type }))
fprintf(['\nevaluate_planner_objective: Shock values need to be specified in level.\n']) fprintf('\nevaluate_planner_objective: Shock values need to be specified in level.\n')
end end
u([M_.det_shocks(shock_indices).exo_id])=[M_.det_shocks(shock_indices).value]; u([M_.det_shocks(shock_indices).exo_id])=[M_.det_shocks(shock_indices).value];
else else

View File

@ -298,7 +298,7 @@ input.fitfun = fitfun; % record used input
if isempty(fitfun) if isempty(fitfun)
% fitfun = definput.fitfun; % fitfun = definput.fitfun;
% warning(['Objective function not determined, ''' fitfun ''' used']); % warning(['Objective function not determined, ''' fitfun ''' used']);
error(['Objective function not determined']); error('Objective function not determined');
end end
if ~ischar(fitfun) if ~ischar(fitfun)
error('first argument FUN must be a string'); error('first argument FUN must be a string');
@ -328,7 +328,7 @@ if isempty(insigma)
if all(size(myeval(xstart)) > 1) if all(size(myeval(xstart)) > 1)
insigma = std(xstart, 0, 2); insigma = std(xstart, 0, 2);
if any(insigma == 0) if any(insigma == 0)
error(['Initial search volume is zero, choose SIGMA or X0 appropriate']); error('Initial search volume is zero, choose SIGMA or X0 appropriate');
end end
else else
% will be captured later % will be captured later
@ -510,7 +510,7 @@ while irun <= myeval(opts.Restarts) % for-loop does not work with resume
stopTolX = myeval(opts.TolX); % reevaluate these stopTolX = myeval(opts.TolX); % reevaluate these
stopTolUpX = myeval(opts.TolUpX); stopTolUpX = myeval(opts.TolUpX);
else else
error(['Initial step sizes (SIGMA) not determined']); error('Initial step sizes (SIGMA) not determined');
end end
end end
@ -543,10 +543,10 @@ while irun <= myeval(opts.Restarts) % for-loop does not work with resume
% Initialize dynamic internal state parameters % Initialize dynamic internal state parameters
if any(insigma <= 0) if any(insigma <= 0)
error(['Initial search volume (SIGMA) must be greater than zero']); error('Initial search volume (SIGMA) must be greater than zero');
end end
if max(insigma)/min(insigma) > 1e6 if max(insigma)/min(insigma) > 1e6
error(['Initial search volume (SIGMA) badly conditioned']); error('Initial search volume (SIGMA) badly conditioned');
end end
sigma = max(insigma); % overall standard deviation sigma = max(insigma); % overall standard deviation
pc = zeros(N,1); ps = zeros(N,1); % evolution paths for C and sigma pc = zeros(N,1); ps = zeros(N,1); % evolution paths for C and sigma

View File

@ -148,7 +148,7 @@ while i<n
x = check_bounds(x,bounds); x = check_bounds(x,bounds);
end end
if Verbose if Verbose
fprintf(['Done for param %s = %8.4f; f = %8.4f\n'],parameter_names{i},x(i),f0) fprintf('Done for param %s = %8.4f; f = %8.4f\n',parameter_names{i},x(i),f0)
end end
end end
xh1=x; xh1=x;

View File

@ -219,7 +219,7 @@ if outer_product_gradient
hessian_mat = zeros(size(f0,1),n*n); hessian_mat = zeros(size(f0,1),n*n);
for i=1:n for i=1:n
if i > 1 if i > 1
k=[i:n:n*(i-1)]; k=i:n:n*(i-1);
hessian_mat(:,(i-1)*n+1:(i-1)*n+i-1)=hessian_mat(:,k); hessian_mat(:,(i-1)*n+1:(i-1)*n+i-1)=hessian_mat(:,k);
end end
hessian_mat(:,(i-1)*n+i)=(f1(:,i)+f_1(:,i)-2*f0)./(hess_info.h1(i)*h_1(i)); hessian_mat(:,(i-1)*n+i)=(f1(:,i)+f_1(:,i)-2*f0)./(hess_info.h1(i)*h_1(i));

View File

@ -149,7 +149,7 @@ while norm(gg)>gtol && check==0 && jit<nit
tic1 = tic; tic1 = tic;
icount=icount+1; icount=icount+1;
penalty = fval0(icount); penalty = fval0(icount);
disp_verbose([' '],Verbose) disp_verbose(' ',Verbose)
disp_verbose(['Iteration ',num2str(icount)],Verbose) disp_verbose(['Iteration ',num2str(icount)],Verbose)
[fval,x0] = csminit1(func0,xparam1,penalty,fval0(icount),gg,0,H,Verbose,varargin{:}); [fval,x0] = csminit1(func0,xparam1,penalty,fval0(icount),gg,0,H,Verbose,varargin{:});
if igrad if igrad
@ -335,11 +335,11 @@ if jit==nit
end end
if norm(gg)<=gtol if norm(gg)<=gtol
disp_verbose(['Estimation ended:'],Verbose) disp_verbose('Estimation ended:',Verbose)
disp_verbose(['Gradient norm < ', num2str(gtol)],Verbose) disp_verbose(['Gradient norm < ', num2str(gtol)],Verbose)
end end
if check==1 if check==1
disp_verbose(['Estimation successful.'],Verbose) disp_verbose('Estimation successful.',Verbose)
end end
return return

View File

@ -394,7 +394,7 @@ while (func_count < max_func_calls) && (iter_count < max_iterations) && (simplex
end end
else else
if isfinite(fv(1)) if isfinite(fv(1))
dprintf(['%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 else
dprintf('%s %s %12.7E %s', iter_, fval_, critX, move) dprintf('%s %s %12.7E %s', iter_, fval_, critX, move)
end end

View File

@ -125,7 +125,7 @@ for it_=start:incr:finish
correcting_factor=correcting_factor*4; correcting_factor=correcting_factor*4;
if verbose if verbose
disp(['The Jacobian matrix is singular, det(Jacobian)=' num2str(detJ,'%f') '.']) disp(['The Jacobian matrix is singular, det(Jacobian)=' num2str(detJ,'%f') '.'])
disp([' trying to correct the Jacobian matrix:']) disp(' trying to correct the Jacobian matrix:')
disp([' correcting_factor=' num2str(correcting_factor,'%f') ' max(Jacobian)=' num2str(full(max_factor),'%f')]) disp([' correcting_factor=' num2str(correcting_factor,'%f') ' max(Jacobian)=' num2str(full(max_factor),'%f')])
end end
dx = - r/(g1+correcting_factor*speye(Blck_size)); dx = - r/(g1+correcting_factor*speye(Blck_size));

View File

@ -761,7 +761,7 @@ while 1
nsteps(2:kg)=nsteps(1:kg-1); nsteps(2:kg)=nsteps(1:kg-1);
end end
nsteps(1)=dx/(abs(h)*norm(g0)); nsteps(1)=dx/(abs(h)*norm(g0));
kk=sum(nsteps(1:kg).*[kg:-1:1])/sum([kg:-1:1]); kk=sum(nsteps(1:kg).*[kg:-1:1])/sum(kg:-1:1);
if kk>des if kk>des
if kg==1 if kg==1
h=h*(kk-des+1); h=h*(kk-des+1);

View File

@ -315,7 +315,7 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for'
% Build a command file to test the matlab execution and dynare path ... % Build a command file to test the matlab execution and dynare path ...
fid = fopen('Tracing.m', 'w+'); fid = fopen('Tracing.m', 'w+');
s1=(['fT = fopen(''MatlabOctaveIsOk.txt'',''w+'');\n']); s1=('fT = fopen(''MatlabOctaveIsOk.txt'',''w+'');\n');
s2='fclose(fT);\n'; s2='fclose(fT);\n';
SBS=strfind(DataInput(Node).DynarePath,'\'); SBS=strfind(DataInput(Node).DynarePath,'\');
DPStr=DataInput(Node).DynarePath; DPStr=DataInput(Node).DynarePath;
@ -329,17 +329,17 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for'
DPStrNew=[DPStrNew,DPStr(SBS(end)+1:end)]; DPStrNew=[DPStrNew,DPStr(SBS(end)+1:end)];
end end
s3=['addpath(''',DPStrNew,'''),\n']; s3=['addpath(''',DPStrNew,'''),\n'];
s4=['try,\n dynareroot = dynare_config();\n']; s4='try,\n dynareroot = dynare_config();\n';
s41=([' fT = fopen(''DynareIsOk.txt'',''w+'');\n']); s41=(' fT = fopen(''DynareIsOk.txt'',''w+'');\n');
s42=' fclose(fT);\n'; s42=' fclose(fT);\n';
s5=['catch,\n']; s5='catch,\n';
s51=([' fT = fopen(''DynareFailed.txt'',''w+'');\n']); s51=(' fT = fopen(''DynareFailed.txt'',''w+'');\n');
s52=' fclose(fT);\n'; s52=' fclose(fT);\n';
s6=['end,\n']; s6='end,\n';
s7=['if ismac,\n']; s7='if ismac,\n';
s71=([' fT = fopen(''IsMac.txt'',''w+'');\n']); s71=(' fT = fopen(''IsMac.txt'',''w+'');\n');
s72=' fclose(fT);\n'; s72=' fclose(fT);\n';
s8=['end,\n']; s8='end,\n';
send='exit'; send='exit';
StrCommand=([s1,s2,s3,s4,s41,s42,s5,s51,s52,s6,s7,s71,s72,s8,send]); StrCommand=([s1,s2,s3,s4,s41,s42,s5,s51,s52,s6,s7,s71,s72,s8,send]);
@ -530,7 +530,7 @@ for Node=1:length(DataInput) % To obtain a recursive function remove the 'for'
Environment1 = 2; Environment1 = 2;
end end
else else
command_string = ['psinfo \\']; command_string = 'psinfo \\';
[si0, de0] = system(command_string); [si0, de0] = system(command_string);
end end
else else

View File

@ -76,7 +76,7 @@ end
% parallel computations with Strategy == 1 delete the traces (if exists) of % parallel computations with Strategy == 1 delete the traces (if exists) of
% previous computations. % previous computations.
delete(['P_slave_*End.txt']); delete('P_slave_*End.txt');
masterParallel(options_.parallel,[],[],[],[],[],[],options_.parallel_info,1); masterParallel(options_.parallel,[],[],[],[],[],[],options_.parallel_info,1);

View File

@ -68,7 +68,7 @@ for indPC=1:length(Parallel)
delete( 'slaveParallel_input*.mat'); delete( 'slaveParallel_input*.mat');
delete( 'slaveJob*.mat'); delete( 'slaveJob*.mat');
pause(1) pause(1)
delete(['slaveParallel_*.log']); delete('slaveParallel_*.log');
delete ConcurrentCommand1.bat; delete ConcurrentCommand1.bat;
end end

View File

@ -53,8 +53,8 @@ for j=1:lP
skipline() skipline()
disp(['PARALLEL_ERROR:: NumberOfThreadsPerJob = ',int2str(Parallel(j).NumberOfThreadsPerJob),' is not an exact divisor of number of CPUs = ',int2str(length(Parallel(j).CPUnbr)),'!']) disp(['PARALLEL_ERROR:: NumberOfThreadsPerJob = ',int2str(Parallel(j).NumberOfThreadsPerJob),' is not an exact divisor of number of CPUs = ',int2str(length(Parallel(j).CPUnbr)),'!'])
disp([' You must re-set properly NumberOfThreadsPerJob of node ' int2str(j) ' ' Parallel(j).ComputerName]) disp([' You must re-set properly NumberOfThreadsPerJob of node ' int2str(j) ' ' Parallel(j).ComputerName])
disp([' in your configuration file']) disp(' in your configuration file')
error(['PARALLEL_ERROR:: NumberOfThreadsPerJob is not an exact divisor of CPUnbr']) error('PARALLEL_ERROR:: NumberOfThreadsPerJob is not an exact divisor of CPUnbr')
end end
nCPU(j)=length(Parallel(j).CPUnbr)/Parallel(j).NumberOfThreadsPerJob; nCPU(j)=length(Parallel(j).CPUnbr)/Parallel(j).NumberOfThreadsPerJob;
totCPU=totCPU+nCPU(j); totCPU=totCPU+nCPU(j);

View File

@ -49,9 +49,9 @@ for indPC=1:length(Parallel)
for i=1:length(NewFilesFromSlaves) for i=1:length(NewFilesFromSlaves)
SlashNumberAndPosition=[]; SlashNumberAndPosition=[];
PRCDirPosition=findstr(NewFilesFromSlaves{i}, ([PRCDir])); PRCDirPosition=findstr(NewFilesFromSlaves{i}, (PRCDir));
sT=NewFilesFromSlaves{i}; sT=NewFilesFromSlaves{i};
sT(1:(PRCDirPosition+length([PRCDir]))-2)=[]; sT(1:(PRCDirPosition+length(PRCDir))-2)=[];
sT(1)='.'; sT(1)='.';
SlashNumberAndPosition=findstr(sT,fS); SlashNumberAndPosition=findstr(sT,fS);
fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)}; fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)};

View File

@ -48,7 +48,7 @@ for indPC=1:length(Parallel)
end end
if ischar(NamFileInput0) if ischar(NamFileInput0)
for j=1:size(NamFileInput0,1) for j=1:size(NamFileInput0,1)
NamFile(j,:)={['./'],deblank(NamFileInput0(j,:))}; NamFile(j,:)={'./',deblank(NamFileInput0(j,:))};
end end
NamFileInput = NamFile; NamFileInput = NamFile;
end end
@ -94,7 +94,7 @@ for indPC=1:length(Parallel)
else else
if ischar(NamFileInput0) if ischar(NamFileInput0)
for j=1:size(NamFileInput0,1) for j=1:size(NamFileInput0,1)
NamFile(j,:)={['.\'],deblank(NamFileInput0(j,:))}; NamFile(j,:)={'.\',deblank(NamFileInput0(j,:))};
end end
NamFileInput = NamFile; NamFileInput = NamFile;
end end

View File

@ -51,9 +51,9 @@ for indPC=1:length(Parallel)
for i=1:length(NewFilesFromSlaves) for i=1:length(NewFilesFromSlaves)
SlashNumberAndPosition=[]; SlashNumberAndPosition=[];
PRCDirPosition=findstr(NewFilesFromSlaves{i}, ([PRCDir])); PRCDirPosition=findstr(NewFilesFromSlaves{i}, (PRCDir));
sT=NewFilesFromSlaves{i}; sT=NewFilesFromSlaves{i};
sT(1:(PRCDirPosition+length([PRCDir]))-2)=[]; sT(1:(PRCDirPosition+length(PRCDir))-2)=[];
sT(1)='.'; sT(1)='.';
SlashNumberAndPosition=findstr(sT,fS); SlashNumberAndPosition=findstr(sT,fS);
fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)}; fileaddress={sT(1:SlashNumberAndPosition(end)),sT(SlashNumberAndPosition(end)+1:end)};

View File

@ -43,7 +43,7 @@ catch
end end
fslave = dir( ['slaveParallel_input',int2str(njob),'.mat']); fslave = dir( ['slaveParallel_input',int2str(njob),'.mat']);
fbreak = dir( ['slaveParallel_break.mat']); fbreak = dir( 'slaveParallel_break.mat');
if isempty(fslave) || ~isempty(fbreak) if isempty(fslave) || ~isempty(fbreak)
error('Master asked to break the job'); error('Master asked to break the job');
end end

View File

@ -102,7 +102,7 @@ if nargin>8 && initialize==1
evalin('base','clear PRCDirTmp,') evalin('base','clear PRCDirTmp,')
else else
% Delete the traces (if existing) of last local session of computations. % Delete the traces (if existing) of last local session of computations.
mydelete(['slaveParallel_input*.mat']); mydelete('slaveParallel_input*.mat');
end end
return return
end end
@ -183,11 +183,11 @@ if parallel_recover ==0
case 1 case 1
if exist('fGlobalVar','var') if exist('fGlobalVar','var')
save(['temp_input.mat'],'fInputVar','fGlobalVar') save('temp_input.mat','fInputVar','fGlobalVar')
else else
save(['temp_input.mat'],'fInputVar') save('temp_input.mat','fInputVar')
end end
save(['temp_input.mat'],'Parallel','-append') save('temp_input.mat','Parallel','-append')
closeSlave(Parallel,PRCDir,-1); closeSlave(Parallel,PRCDir,-1);
end end
@ -608,7 +608,7 @@ if parallel_recover ==0
hstatus(j) = axes('position',[0.05/ncol+(jcol-1)/ncol vstart-vspace*(jrow-1) 0.9/ncol 0.3*vspace], ... hstatus(j) = axes('position',[0.05/ncol+(jcol-1)/ncol vstart-vspace*(jrow-1) 0.9/ncol 0.3*vspace], ...
'box','on','xtick',[],'ytick',[],'xlim',[0 1],'ylim',[0 1]); 'box','on','xtick',[],'ytick',[],'xlim',[0 1],'ylim',[0 1]);
hpat(j) = patch([0 0 0 0],[0 1 1 0],'r','EdgeColor','r'); hpat(j) = patch([0 0 0 0],[0 1 1 0],'r','EdgeColor','r');
htit(j) = title(['Initialize ...']); htit(j) = title('Initialize ...');
end end
@ -902,13 +902,13 @@ switch Strategy
catch catch
end end
mydelete(['*_core*_input*.mat']); mydelete('*_core*_input*.mat');
end end
delete ConcurrentCommand1.bat delete ConcurrentCommand1.bat
case 1 case 1
delete(['temp_input.mat']) delete('temp_input.mat')
if newInstance if newInstance
if isempty(dir('dynareParallelLogFiles')) if isempty(dir('dynareParallelLogFiles'))
rmdir('dynareParallelLogFiles'); rmdir('dynareParallelLogFiles');

View File

@ -194,7 +194,7 @@ if(options_.ACES_solver)
for i=1:num_inst for i=1:num_inst
i_tmp = strmatch(deblank(lq_instruments.names(i,:)), M_.endo_names,'exact'); i_tmp = strmatch(deblank(lq_instruments.names(i,:)), M_.endo_names,'exact');
if isempty(i_tmp) if isempty(i_tmp)
error (['One of the specified instrument variables does not exist']) ; error ('One of the specified instrument variables does not exist') ;
else else
i_var(i) = i_tmp; i_var(i) = i_tmp;
end end
@ -303,7 +303,7 @@ if ( M_.maximum_lag <= 1) && (M_.maximum_lead <= 1)
if num_exp_0>0 if num_exp_0>0
AA3(:,exp_0)=AA1(:,exp_0); AA3(:,exp_0)=AA1(:,exp_0);
XX0=zeros(nendo,num_exp_0); XX0=zeros(nendo,num_exp_0);
AA1(:,exp_0)=XX0(:,[1:num_exp_0]) AA1(:,exp_0)=XX0(:,1:num_exp_0)
end end
end end
end end

View File

@ -32,7 +32,7 @@ function plan = basic_plan(plan, exogenous, expectation_type, date, value)
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
if ~ischar(expectation_type) || size(expectation_type,1) ~= 1 if ~ischar(expectation_type) || size(expectation_type,1) ~= 1
error(['in basic_plan the third argument should be a string containing the simulation type (''perfect_foresight'' or ''surprise'')']); error('in basic_plan the third argument should be a string containing the simulation type (''perfect_foresight'' or ''surprise'')');
end end
exogenous = strtrim(exogenous); exogenous = strtrim(exogenous);
ix = find(strcmp(exogenous, plan.exo_names)); ix = find(strcmp(exogenous, plan.exo_names));

View File

@ -32,7 +32,7 @@ function plan = flip_plan(plan, exogenous, endogenous, expectation_type, date, v
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
if ~ischar(expectation_type) || size(expectation_type,1) ~= 1 if ~ischar(expectation_type) || size(expectation_type,1) ~= 1
error(['in flip_plan the fourth argument should be a string containing the simulation type (''perfect_foresight'' or ''surprise'')']); error('in flip_plan the fourth argument should be a string containing the simulation type (''perfect_foresight'' or ''surprise'')');
end end
exogenous = strtrim(exogenous); exogenous = strtrim(exogenous);
ix = find(strcmp(exogenous, plan.endo_names)); ix = find(strcmp(exogenous, plan.endo_names));

View File

@ -118,7 +118,7 @@ while ~(cvg || iter > options_.simul.maxit)
correcting_factor=correcting_factor*4; correcting_factor=correcting_factor*4;
if verbose if verbose
disp(['The Jacobian matrix is singular, det(Jacobian)=' num2str(detJ,'%f') '.']); disp(['The Jacobian matrix is singular, det(Jacobian)=' num2str(detJ,'%f') '.']);
disp([' trying to correct the Jacobian matrix:']); disp(' trying to correct the Jacobian matrix:');
disp([' correcting_factor=' num2str(correcting_factor,'%f') ' max(Jacobian)=' num2str(full(max_factor),'%f')]); disp([' correcting_factor=' num2str(correcting_factor,'%f') ' max(Jacobian)=' num2str(full(max_factor),'%f')]);
end end
dx = (g1aa+correcting_factor*speye(periods*Blck_size))\ba- ya_save; dx = (g1aa+correcting_factor*speye(periods*Blck_size))\ba- ya_save;

View File

@ -97,7 +97,7 @@ elseif iscell(o.xTickLabels)
x = o.xTicks; x = o.xTicks;
xTickLabels = o.xTickLabels; xTickLabels = o.xTickLabels;
else else
x = [1:dd.ndat]; x = 1:dd.ndat;
xTickLabels = strings(dd); xTickLabels = strings(dd);
end end
fprintf(fid, 'xticklabels={'); fprintf(fid, 'xticklabels={');

View File

@ -64,7 +64,7 @@ if nargin==8
if isfield(opts_decomp,'fig_name') if isfield(opts_decomp,'fig_name')
fig_name = opts_decomp.fig_name; fig_name = opts_decomp.fig_name;
% fig_name = ['_' fig_name]; % fig_name = ['_' fig_name];
fig_name1 = [fig_name]; fig_name1 = fig_name;
fig_name = [fig_name '_']; fig_name = [fig_name '_'];
end end
if screen_shocks if screen_shocks

View File

@ -269,7 +269,7 @@ for j=1:nvar
if nfigs>1 if nfigs>1
suffix = ['_detail_' int2str(jf)]; suffix = ['_detail_' int2str(jf)];
else else
suffix = ['_detail']; suffix = '_detail';
end end
if ~options_.plot_shock_decomp.expand if ~options_.plot_shock_decomp.expand
dyn_saveas(fhandle,[GraphDirectoryName, filesep, M_.fname, ... dyn_saveas(fhandle,[GraphDirectoryName, filesep, M_.fname, ...

View File

@ -605,7 +605,7 @@ for i=1:ngroups
end end
zothers = sum(z(:,1:nshocks,:),2); zothers = sum(z(:,1:nshocks,:),2);
shock_groups.(['group' int2str(ngroups+1)]).label = 'Others'; shock_groups.(['group' int2str(ngroups+1)]).label = 'Others';
shock_groups.(['group' int2str(ngroups+1)]).shocks = cellstr(M_.exo_names(find(~ismember([1:M_.exo_nbr],kcum)),:))'; shock_groups.(['group' int2str(ngroups+1)]).shocks = cellstr(M_.exo_names(find(~ismember(1:M_.exo_nbr,kcum)),:))';
M_.shock_groups.(options_.plot_shock_decomp.use_shock_groups)=shock_groups; M_.shock_groups.(options_.plot_shock_decomp.use_shock_groups)=shock_groups;
if any(any(zothers)) if any(any(zothers))
shock_names = [shock_names; {'Others + Initial Values'}]; shock_names = [shock_names; {'Others + Initial Values'}];

View File

@ -129,7 +129,7 @@ else
running_text = 'Fast realtime shock decomposition '; running_text = 'Fast realtime shock decomposition ';
end end
newString=sprintf(running_text); newString=sprintf(running_text);
fprintf(['%s'],newString); fprintf('%s',newString);
for j=presample+1:nobs for j=presample+1:nobs
% evalin('base',['options_.nobs=' int2str(j) ';']) % evalin('base',['options_.nobs=' int2str(j) ';'])

View File

@ -60,7 +60,7 @@ if local_order == 1
y = y2(:,M_.maximum_lag+1:end)-y1; y = y2(:,M_.maximum_lag+1:end)-y1;
else else
% eliminate shocks with 0 variance % eliminate shocks with 0 variance
i_exo_var = setdiff([1:M_.exo_nbr],find(diag(M_.Sigma_e) == 0 )); i_exo_var = setdiff(1:M_.exo_nbr,find(diag(M_.Sigma_e) == 0 ));
nxs = length(i_exo_var); nxs = length(i_exo_var);
ex1 = zeros(long+drop,M_.exo_nbr); ex1 = zeros(long+drop,M_.exo_nbr);
chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var)); chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var));

View File

@ -72,7 +72,7 @@ if replic > 1
end end
% eliminate shocks with 0 variance % eliminate shocks with 0 variance
i_exo_var = setdiff([1:M_.exo_nbr],find(diag(M_.Sigma_e) == 0)); i_exo_var = setdiff(1:M_.exo_nbr,find(diag(M_.Sigma_e) == 0));
nxs = length(i_exo_var); nxs = length(i_exo_var);
exo_simul = zeros(options_.periods,M_.exo_nbr); exo_simul = zeros(options_.periods,M_.exo_nbr);
chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var)); chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var));

View File

@ -53,7 +53,7 @@ end
nx = size(dr.ghu,2); nx = size(dr.ghu,2);
y_ = zeros(size(y0,1),iter+ykmin); y_ = zeros(size(y0,1),iter+ykmin);
y_(:,1:ykmin) = y0; y_(:,1:ykmin) = y0;
k1 = [ykmin:-1:1]; k1 = ykmin:-1:1;
k2 = dr.kstate(find(dr.kstate(:,2) <= ykmin+1),[1 2]); k2 = dr.kstate(find(dr.kstate(:,2) <= ykmin+1),[1 2]);
k2 = k2(:,1)+(ykmin+1-k2(:,2))*endo_nbr; k2 = k2(:,1)+(ykmin+1-k2(:,2))*endo_nbr;
k3 = M_.lead_lag_incidence(1:ykmin,:)'; k3 = M_.lead_lag_incidence(1:ykmin,:)';
@ -64,14 +64,14 @@ k4 = k4(:,1)+(ykmin+1-k4(:,2))*endo_nbr;
nvar = length(var_list); nvar = length(var_list);
if nvar == 0 if nvar == 0
nvar = endo_nbr; nvar = endo_nbr;
ivar = [1:nvar]; ivar = 1:nvar;
else else
ivar=zeros(nvar,1); ivar=zeros(nvar,1);
for i=1:nvar for i=1:nvar
i_tmp = strmatch(var_list{i}, M_.endo_names, 'exact'); i_tmp = strmatch(var_list{i}, M_.endo_names, 'exact');
if isempty(i_tmp) if isempty(i_tmp)
disp(var_list{i}) disp(var_list{i})
error (['One of the variable specified does not exist']) ; error ('One of the variable specified does not exist') ;
else else
ivar(i) = i_tmp; ivar(i) = i_tmp;
end end

View File

@ -73,7 +73,7 @@ if M_.maximum_endo_lag == 0
fprintf('\nSTOCHASTIC_SOLVER: Dynare does not solve purely forward models with var_exo_det.\n') fprintf('\nSTOCHASTIC_SOLVER: Dynare does not solve purely forward models with var_exo_det.\n')
fprintf('STOCHASTIC_SOLVER: To circumvent this restriction, you can add a backward-looking dummy equation of the form:\n') fprintf('STOCHASTIC_SOLVER: To circumvent this restriction, you can add a backward-looking dummy equation of the form:\n')
fprintf('STOCHASTIC_SOLVER: junk=0.9*junk(-1);\n') fprintf('STOCHASTIC_SOLVER: junk=0.9*junk(-1);\n')
error(['var_exo_det not implemented for purely forward models']) error('var_exo_det not implemented for purely forward models')
end end
end end
@ -81,7 +81,7 @@ if M_.maximum_endo_lead==0 && M_.exo_det_nbr~=0
fprintf('\nSTOCHASTIC_SOLVER: Dynare does not solve purely backward models with var_exo_det.\n') fprintf('\nSTOCHASTIC_SOLVER: Dynare does not solve purely backward models with var_exo_det.\n')
fprintf('STOCHASTIC_SOLVER: To circumvent this restriction, you can add a foward-looking dummy equation of the form:\n') fprintf('STOCHASTIC_SOLVER: To circumvent this restriction, you can add a foward-looking dummy equation of the form:\n')
fprintf('STOCHASTIC_SOLVER: junk=0.9*junk(+1);\n') fprintf('STOCHASTIC_SOLVER: junk=0.9*junk(+1);\n')
error(['var_exo_det not implemented for purely backwards models']) error('var_exo_det not implemented for purely backwards models')
end end
if options_.k_order_solver if options_.k_order_solver
@ -261,7 +261,7 @@ else
k1 = nonzeros(M_.lead_lag_incidence(:,order_var)'); k1 = nonzeros(M_.lead_lag_incidence(:,order_var)');
kk = [k1; length(k1)+(1:M_.exo_nbr+M_.exo_det_nbr)']; kk = [k1; length(k1)+(1:M_.exo_nbr+M_.exo_det_nbr)'];
nk = size(kk,1); nk = size(kk,1);
kk1 = reshape([1:nk^2],nk,nk); kk1 = reshape(1:nk^2,nk,nk);
kk1 = kk1(kk,kk); kk1 = kk1(kk,kk);
hessian1 = hessian1(:,kk1(:)); hessian1 = hessian1(:,kk1(:));
end end
@ -295,7 +295,7 @@ if M_.exo_det_nbr > 0
zud=[zeros(nspred,M_.exo_det_nbr);dr.ghud{1};gx(:,1:nspred)*hud;zeros(M_.exo_nbr,M_.exo_det_nbr);eye(M_.exo_det_nbr)]; zud=[zeros(nspred,M_.exo_det_nbr);dr.ghud{1};gx(:,1:nspred)*hud;zeros(M_.exo_nbr,M_.exo_det_nbr);eye(M_.exo_det_nbr)];
R1 = hessian1*kron(zx,zud); R1 = hessian1*kron(zx,zud);
dr.ghxud = cell(M_.exo_det_length,1); dr.ghxud = cell(M_.exo_det_length,1);
kf = [M_.endo_nbr-nfwrd-nboth+1:M_.endo_nbr]; kf = M_.endo_nbr-nfwrd-nboth+1:M_.endo_nbr;
kp = nstatic+[1:nspred]; kp = nstatic+[1:nspred];
dr.ghxud{1} = -M1*(R1+f1*dr.ghxx(kf,:)*kron(dr.ghx(kp,:),dr.ghud{1}(kp,:))); dr.ghxud{1} = -M1*(R1+f1*dr.ghxx(kf,:)*kron(dr.ghx(kp,:),dr.ghud{1}(kp,:)));
Eud = eye(M_.exo_det_nbr); Eud = eye(M_.exo_det_nbr);

View File

@ -32,7 +32,7 @@ function info=test_for_deep_parameters_calibration(M_)
plist = list_of_parameters_calibrated_as_NaN(M_); plist = list_of_parameters_calibrated_as_NaN(M_);
if ~isempty(plist) if ~isempty(plist)
info=1; info=1;
message = ['Some of the parameters have no value (' ]; message = 'Some of the parameters have no value (' ;
for i=1:length(plist) for i=1:length(plist)
if i<length(plist) if i<length(plist)
message = [message, plist{i} ', ']; message = [message, plist{i} ', '];

@ -1 +1 @@
Subproject commit a6b97581c379bde8e5022e230075c18421a8094a Subproject commit 3362b3f43053a2bb5d3d3a1dbfb1a9e0c42a8fb8