Skip to content
Snippets Groups Projects
Verified Commit 0e2902d9 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'forecast' of git.dynare.org:JohannesPfeifer/dynare

Ref. !2319
parents 17271e48 3dd8d75b
Branches
No related tags found
1 merge request!2319:bug: error function: Fix various syntax bugs
......@@ -133,7 +133,7 @@ try
for i = 1:ndraws
draw = o.draw();
if ~o.admissible(draw)
error()
error('problem in admissible')
end
end
t(1) = true;
......
......@@ -177,8 +177,7 @@ if (distribution==4)% Beta distribution
if length(idx)>1
error('Multiplicity of solutions for the beta distribution specification.')
elseif isempty(idx)
disp('No solution for the beta distribution specification. You should reduce the variance.')
error();
error('No solution for the beta distribution specification. You should reduce the variance.')
end
alpha = real_roots(idx);
beta = ((1-m)*alpha+2*m-1)/m;
......
......@@ -44,6 +44,5 @@ if strcmpi(type,'posterior')
elseif strcmpi(type,'prior')
CorrFileNumber = length(dir([M_.dname '/prior/moments/' M_.fname '_PriorCorrelations*']));
else
disp('dsge_simulated_theoretical_correlation:: Unknown type!');
error()
error('dsge_simulated_theoretical_correlation:: Unknown type!');
end
......@@ -44,8 +44,7 @@ elseif strcmpi(type,'prior')
CheckPath('prior/moments',M_.dname);
posterior = 0;
else
disp('dsge_simulated_theoretical_covariance:: Unknown type!')
error();
error('dsge_simulated_theoretical_covariance:: Unknown type!')
end
%delete old stale files before creating new ones
......
......@@ -46,8 +46,7 @@ elseif strcmpi(type,'prior')
CheckPath('prior/moments',M_.dname);
posterior = 0;
else
disp('dsge_simulated_theoretical_variance_decomposition:: Unknown type!')
error()
error('dsge_simulated_theoretical_variance_decomposition:: Unknown type!')
end
%delete old stale files before creating new ones
......
......@@ -9,14 +9,18 @@ function [y_,int_width,int_width_ME]=simultxdet(y0,ex,ex_det, iorder,var_list,M_
% ex_det: matrix of deterministic exogenous shocks, starting at period 1-M_.maximum_lag
% iorder: order of approximation
% var_list: list of endogenous variables to simulate
% int_width_ME:distance between upper bound and
% mean forecast when considering measurement error
% M_: Dynare model structure
% oo_: Dynare results structure
% options_: Dynare options structure
%
% OUTPUTS:
% yf: mean forecast
% int_width: distance between upper bound and
% mean forecast
% int_width_ME:distance between upper bound and
% mean forecast when considering measurement error
% int_width_ME:distance between upper bound and
% mean forecast when considering measurement error
%
% The forecast horizon is equal to size(ex, 1).
% The condition size(ex,1)+M_.maximum_lag=size(ex_det,1) must be verified
......@@ -118,6 +122,8 @@ elseif iorder == 2
end
k1 = k1+1;
end
else
error('simultxdet.m: order>2 not supported.')
end
[A,B] = kalman_transition_matrix(dr,nstatic+(1:nspred),1:nc);
......@@ -132,7 +138,7 @@ sigma_y = 0;
var_yf=NaN(iter,nvar); %initialize
for i=1:iter
sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1;
sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1; %only valid at first order, needs to be fixed, see https://git.dynare.org/Dynare/dynare/-/issues/1940
var_yf(i,:) = diag(sigma_y1)';
if i == iter
break
......
......@@ -84,6 +84,6 @@ end;
verbatim;
if ~isequal(M_.observed_exo_names, {'ey'; 'ex'})
error()
error('Arguments are not identical')
end
end;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment