2016-03-11 16:01:21 +01:00
|
|
|
function oo_=make_ex_(M_,options_,oo_)
|
2006-10-29 18:27:48 +01:00
|
|
|
% forms oo_.exo_simul and oo_.exo_det_simul
|
2009-10-23 12:03:03 +02:00
|
|
|
%
|
2006-10-29 18:27:48 +01:00
|
|
|
% INPUTS
|
2016-03-11 16:01:21 +01:00
|
|
|
% M_: Dynare model structure
|
|
|
|
% options_: Dynare options structure
|
|
|
|
% oo_: Dynare results structure
|
2017-05-16 15:10:20 +02:00
|
|
|
%
|
2006-10-29 18:27:48 +01:00
|
|
|
% OUTPUTS
|
2016-03-11 16:01:21 +01:00
|
|
|
% oo_: Dynare results structure
|
2009-10-23 12:03:03 +02:00
|
|
|
%
|
2006-10-29 18:27:48 +01:00
|
|
|
% ALGORITHM
|
2017-05-16 15:10:20 +02:00
|
|
|
%
|
2006-10-29 18:27:48 +01:00
|
|
|
% SPECIAL REQUIREMENTS
|
2017-05-16 15:10:20 +02:00
|
|
|
%
|
2008-08-01 14:40:33 +02:00
|
|
|
|
2017-05-18 18:36:38 +02:00
|
|
|
% Copyright (C) 1996-2017 Dynare Team
|
2008-08-01 14:40:33 +02:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
|
|
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2016-03-11 16:01:21 +01:00
|
|
|
global ex0_
|
2009-12-16 18:17:34 +01:00
|
|
|
|
|
|
|
if isempty(oo_.exo_steady_state)
|
2005-02-18 20:54:39 +01:00
|
|
|
oo_.exo_steady_state = zeros(M_.exo_nbr,1);
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|
2011-02-10 15:54:23 +01:00
|
|
|
if M_.exo_det_nbr > 1 && isempty(oo_.exo_det_steady_state)
|
2006-06-02 09:42:00 +02:00
|
|
|
oo_.exo_det_steady_state = zeros(M_.exo_det_nbr,1);
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|
2014-04-08 17:43:58 +02:00
|
|
|
|
|
|
|
% Initialize oo_.exo_simul
|
2015-07-29 15:41:17 +02:00
|
|
|
if isempty(M_.exo_histval)
|
|
|
|
if isempty(ex0_)
|
|
|
|
oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
|
|
|
|
else
|
|
|
|
oo_.exo_simul = [ repmat(ex0_',M_.maximum_lag,1) ; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1) ];
|
|
|
|
end
|
2014-04-08 17:43:58 +02:00
|
|
|
else
|
2015-07-29 15:41:17 +02:00
|
|
|
if isempty(ex0_)
|
|
|
|
oo_.exo_simul = [M_.exo_histval'; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1)];
|
|
|
|
else
|
|
|
|
error('histval and endval cannot be used simultaneously')
|
|
|
|
end
|
2017-05-16 15:10:20 +02:00
|
|
|
end
|
2006-10-29 18:27:48 +01:00
|
|
|
|
2014-04-08 17:43:58 +02:00
|
|
|
% Initialize oo_.exo_det_simul
|
2009-12-16 18:17:34 +01:00
|
|
|
if M_.exo_det_nbr > 0
|
2015-07-29 15:41:17 +02:00
|
|
|
if isempty(M_.exo_det_histval)
|
|
|
|
oo_.exo_det_simul = repmat(oo_.exo_det_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
|
|
|
|
else
|
|
|
|
oo_.exo_det_simul = [M_.exo_det_histval'; repmat(oo_.exo_det_steady_state',options_.periods+M_.maximum_lead,1)];
|
|
|
|
end
|
2014-04-08 17:43:58 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
% Add temporary shocks
|
|
|
|
if isfield(M_, 'det_shocks')
|
|
|
|
for i = 1:length(M_.det_shocks)
|
|
|
|
k = M_.det_shocks(i).periods + M_.maximum_lag;
|
|
|
|
ivar = M_.det_shocks(i).exo_id;
|
|
|
|
v = M_.det_shocks(i).value;
|
|
|
|
if ~M_.det_shocks(i).exo_det
|
|
|
|
if ~M_.det_shocks(i).multiplicative
|
|
|
|
oo_.exo_simul(k,ivar) = v;
|
|
|
|
else
|
|
|
|
oo_.exo_simul(k,ivar) = oo_.exo_simul(k,ivar) * v;
|
|
|
|
end
|
|
|
|
else
|
|
|
|
if ~M_.det_shocks(i).multiplicative
|
|
|
|
oo_.exo_det_simul(k,ivar) = v;
|
|
|
|
else
|
|
|
|
oo_.exo_det_simul(k,ivar) = oo_.exo_det_simul(k,ivar) * v;
|
|
|
|
end
|
|
|
|
end
|
2005-09-11 11:39:21 +02:00
|
|
|
end
|
2014-04-08 17:43:58 +02:00
|
|
|
end
|