parent
5a2fbe2f89
commit
cc045caa6f
|
@ -281,10 +281,10 @@ try
|
||||||
evalin('base',[fname '.driver']) ;
|
evalin('base',[fname '.driver']) ;
|
||||||
catch ME
|
catch ME
|
||||||
W = evalin('base','whos');
|
W = evalin('base','whos');
|
||||||
diary off
|
diary off
|
||||||
if ismember(fname,[W(:).name])
|
if ismember(fname,{W(:).name})
|
||||||
error('Your base workspace already contains a variable with the same name as the mod-file. You need to delete it or rename the mod-file.')
|
error('Your base workspace already contains a variable with the same name as the mod-file. You need to delete it or rename the mod-file.')
|
||||||
else
|
else
|
||||||
rethrow(ME)
|
rethrow(ME)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,8 @@ y_ = zeros(size(y0,1),iter+M_.maximum_lag);
|
||||||
y_(:,1) = y0;
|
y_(:,1) = y0;
|
||||||
|
|
||||||
if options_.loglinear && ~options_.logged_steady_state
|
if options_.loglinear && ~options_.logged_steady_state
|
||||||
dr.ys=log(dr.ys);
|
k = get_all_variables_but_lagged_leaded_exogenous(M_);
|
||||||
|
dr.ys(k)=log(dr.ys(k));
|
||||||
end
|
end
|
||||||
|
|
||||||
if ~options_.k_order_solver || (options_.k_order_solver && options_.pruning) %if k_order_pert is not used or if we do not use Dynare++ with k_order_pert
|
if ~options_.k_order_solver || (options_.k_order_solver && options_.pruning) %if k_order_pert is not used or if we do not use Dynare++ with k_order_pert
|
||||||
|
|
|
@ -79,6 +79,12 @@ end
|
||||||
|
|
||||||
if options_.loglinear
|
if options_.loglinear
|
||||||
oo_.Smoother.loglinear = true;
|
oo_.Smoother.loglinear = true;
|
||||||
|
if ~isempty(M_.aux_vars) % deal with lead/lag of exogenous variables
|
||||||
|
exo_lead_lag_index = M_.orig_endo_nbr + find(([M_.aux_vars.type] == 2) | ([M_.aux_vars.type] == 3));
|
||||||
|
else
|
||||||
|
exo_lead_lag_index =[];
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
oo_.Smoother.loglinear = false;
|
oo_.Smoother.loglinear = false;
|
||||||
end
|
end
|
||||||
|
@ -137,6 +143,9 @@ if ~isempty(options_.nk) && options_.nk ~= 0
|
||||||
i_endo_declaration_order = oo_.dr.order_var(i_endo_in_dr_matrices); %get indices of smoothed variables in name vector
|
i_endo_declaration_order = oo_.dr.order_var(i_endo_in_dr_matrices); %get indices of smoothed variables in name vector
|
||||||
if options_.loglinear %logged steady state must be used
|
if options_.loglinear %logged steady state must be used
|
||||||
constant_all_variables=repmat(log(ys(i_endo_declaration_order))',[length(options_.filter_step_ahead),1,gend+max(options_.filter_step_ahead)]);
|
constant_all_variables=repmat(log(ys(i_endo_declaration_order))',[length(options_.filter_step_ahead),1,gend+max(options_.filter_step_ahead)]);
|
||||||
|
if ~isempty(exo_lead_lag_index) && any(ismember(i_endo_declaration_order,exo_lead_lag_index)) % deal with lead/lag of exogenous variables
|
||||||
|
constant_all_variables(:,ismember(i_endo_declaration_order,exo_lead_lag_index),:)=repmat(ys(i_endo_declaration_order(ismember(i_endo_declaration_order,exo_lead_lag_index)))',[length(options_.filter_step_ahead),1,gend+max(options_.filter_step_ahead)]);
|
||||||
|
end
|
||||||
elseif ~options_.loglinear %unlogged steady state must be used
|
elseif ~options_.loglinear %unlogged steady state must be used
|
||||||
constant_all_variables=repmat((ys(i_endo_declaration_order))',[length(options_.filter_step_ahead),1,gend+max(options_.filter_step_ahead)]);
|
constant_all_variables=repmat((ys(i_endo_declaration_order))',[length(options_.filter_step_ahead),1,gend+max(options_.filter_step_ahead)]);
|
||||||
end
|
end
|
||||||
|
@ -157,7 +166,11 @@ for i_endo_in_bayestopt_smoother_varlist=bayestopt_.smoother_saved_var_list'
|
||||||
i_endo_declaration_order = oo_.dr.order_var(i_endo_in_dr); %get indices of smoothed variables in name vector
|
i_endo_declaration_order = oo_.dr.order_var(i_endo_in_dr); %get indices of smoothed variables in name vector
|
||||||
%% Compute constant
|
%% Compute constant
|
||||||
if options_.loglinear == 1 %logged steady state must be used
|
if options_.loglinear == 1 %logged steady state must be used
|
||||||
constant_current_variable=repmat(log(ys(i_endo_declaration_order)),gend,1);
|
if ~isempty(exo_lead_lag_index) && ismember(i_endo_declaration_order,exo_lead_lag_index)% deal with lead/lag of exogenous variables
|
||||||
|
constant_current_variable=repmat(ys(i_endo_declaration_order),gend,1);
|
||||||
|
else
|
||||||
|
constant_current_variable=repmat(log(ys(i_endo_declaration_order)),gend,1);
|
||||||
|
end
|
||||||
elseif options_.loglinear == 0 %unlogged steady state must be used
|
elseif options_.loglinear == 0 %unlogged steady state must be used
|
||||||
constant_current_variable=repmat((ys(i_endo_declaration_order)),gend,1);
|
constant_current_variable=repmat((ys(i_endo_declaration_order)),gend,1);
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue