options_.instruments is now a cell array
This fixes crashes under Octave (while MATLAB seems to accept array-indexing with cell arrays).time-shift
parent
460dba40d7
commit
8cb51e26e6
|
@ -336,7 +336,7 @@ options_.conditional_variance_decomposition = [];
|
||||||
|
|
||||||
% Ramsey policy
|
% Ramsey policy
|
||||||
options_.ramsey_policy = 0;
|
options_.ramsey_policy = 0;
|
||||||
options_.instruments = [];
|
options_.instruments = {};
|
||||||
options_.timeless = 0;
|
options_.timeless = 0;
|
||||||
options_.ramsey.maxit = 500;
|
options_.ramsey.maxit = 500;
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ end
|
||||||
|
|
||||||
instr_id=nan(instr_nbr,1);
|
instr_id=nan(instr_nbr,1);
|
||||||
for j=1:instr_nbr
|
for j=1:instr_nbr
|
||||||
vj=deblank(Instruments(j,:));
|
vj=deblank(Instruments{j});
|
||||||
vj_id=strmatch(vj, endo_names, 'exact');
|
vj_id=strmatch(vj, endo_names, 'exact');
|
||||||
if ~isempty(vj_id)
|
if ~isempty(vj_id)
|
||||||
instr_id(j)=vj_id;
|
instr_id(j)=vj_id;
|
||||||
|
|
|
@ -50,7 +50,7 @@ elseif options_.steadystate_flag
|
||||||
k_inst = [];
|
k_inst = [];
|
||||||
inst_nbr = size(options_.instruments,1);
|
inst_nbr = size(options_.instruments,1);
|
||||||
for i = 1:inst_nbr
|
for i = 1:inst_nbr
|
||||||
k_inst = [k_inst; strmatch(options_.instruments(i,:), M.endo_names, 'exact')];
|
k_inst = [k_inst; strmatch(options_.instruments{i}, M.endo_names, 'exact')];
|
||||||
end
|
end
|
||||||
if inst_nbr == 1
|
if inst_nbr == 1
|
||||||
%solve for instrument, using univariate solver, starting at initial value for instrument
|
%solve for instrument, using univariate solver, starting at initial value for instrument
|
||||||
|
@ -112,7 +112,7 @@ if options_.steadystate_flag
|
||||||
k_inst = [];
|
k_inst = [];
|
||||||
instruments = options_.instruments;
|
instruments = options_.instruments;
|
||||||
for i = 1:size(instruments,1)
|
for i = 1:size(instruments,1)
|
||||||
k_inst = [k_inst; strmatch(instruments(i,:), endo_names, 'exact')];
|
k_inst = [k_inst; strmatch(instruments{i}, endo_names, 'exact')];
|
||||||
end
|
end
|
||||||
ys_init=zeros(size(oo.steady_state)); %create starting vector for steady state computation as only instrument value is handed over
|
ys_init=zeros(size(oo.steady_state)); %create starting vector for steady state computation as only instrument value is handed over
|
||||||
ys_init(k_inst) = x; %set instrument, the only value required for steady state computation, to current value
|
ys_init(k_inst) = x; %set instrument, the only value required for steady state computation, to current value
|
||||||
|
|
|
@ -66,7 +66,7 @@ if options.ramsey_policy
|
||||||
fprintf('\nevaluate_steady_state: The steady state file computation for the Ramsey problem resulted in NaNs.\n')
|
fprintf('\nevaluate_steady_state: The steady state file computation for the Ramsey problem resulted in NaNs.\n')
|
||||||
fprintf('evaluate_steady_state: The steady state was computed conditional on the following initial instrument values: \n')
|
fprintf('evaluate_steady_state: The steady state was computed conditional on the following initial instrument values: \n')
|
||||||
for ii = 1:size(options.instruments,1)
|
for ii = 1:size(options.instruments,1)
|
||||||
fprintf('\t %s \t %f \n',options.instruments(ii,:),ys_init(strmatch(options.instruments(ii,:),M.endo_names,'exact')))
|
fprintf('\t %s \t %f \n',options.instruments{ii},ys_init(strmatch(options.instruments{ii},M.endo_names,'exact')))
|
||||||
end
|
end
|
||||||
fprintf('evaluate_steady_state: The problem occured in the following equations: \n')
|
fprintf('evaluate_steady_state: The problem occured in the following equations: \n')
|
||||||
fprintf('\t Equation(s): ')
|
fprintf('\t Equation(s): ')
|
||||||
|
@ -87,7 +87,7 @@ if options.ramsey_policy
|
||||||
fprintf('\nevaluate_steady_state: The steady state file computation for the Ramsey problem resulted in complex numbers.\n')
|
fprintf('\nevaluate_steady_state: The steady state file computation for the Ramsey problem resulted in complex numbers.\n')
|
||||||
fprintf('evaluate_steady_state: The steady state was computed conditional on the following initial instrument values: \n')
|
fprintf('evaluate_steady_state: The steady state was computed conditional on the following initial instrument values: \n')
|
||||||
for ii = 1:size(options.instruments,1)
|
for ii = 1:size(options.instruments,1)
|
||||||
fprintf('\t %s \t %f \n',options.instruments(ii,:),ys_init(strmatch(options.instruments(ii,:),M.endo_names,'exact')))
|
fprintf('\t %s \t %f \n',options.instruments{ii},ys_init(strmatch(options.instruments{ii},M.endo_names,'exact')))
|
||||||
end
|
end
|
||||||
fprintf('evaluate_steady_state: If those initial values are not admissable, change them using an initval-block.\n')
|
fprintf('evaluate_steady_state: If those initial values are not admissable, change them using an initval-block.\n')
|
||||||
skipline(2)
|
skipline(2)
|
||||||
|
@ -102,7 +102,7 @@ if options.ramsey_policy
|
||||||
fprintf('\nevaluate_steady_state: The steady state file does not solve the steady state for the Ramsey problem.\n')
|
fprintf('\nevaluate_steady_state: The steady state file does not solve the steady state for the Ramsey problem.\n')
|
||||||
fprintf('evaluate_steady_state: Conditional on the following instrument values: \n')
|
fprintf('evaluate_steady_state: Conditional on the following instrument values: \n')
|
||||||
for ii = 1:size(options.instruments,1)
|
for ii = 1:size(options.instruments,1)
|
||||||
fprintf('\t %s \t %f \n',options.instruments(ii,:),ys_init(strmatch(options.instruments(ii,:),M.endo_names,'exact')))
|
fprintf('\t %s \t %f \n',options.instruments{ii},ys_init(strmatch(options.instruments{ii},M.endo_names,'exact')))
|
||||||
end
|
end
|
||||||
fprintf('evaluate_steady_state: the following equations have non-zero residuals: \n')
|
fprintf('evaluate_steady_state: the following equations have non-zero residuals: \n')
|
||||||
for ii=n_multipliers+1:M.endo_nbr
|
for ii=n_multipliers+1:M.endo_nbr
|
||||||
|
@ -150,7 +150,7 @@ if options.ramsey_policy
|
||||||
fprintf('\nevaluate_steady_state: The steady state computation for the Ramsey problem resulted in NaNs.\n')
|
fprintf('\nevaluate_steady_state: The steady state computation for the Ramsey problem resulted in NaNs.\n')
|
||||||
fprintf('evaluate_steady_state: The steady state computation resulted in the following instrument values: \n')
|
fprintf('evaluate_steady_state: The steady state computation resulted in the following instrument values: \n')
|
||||||
for i = 1:size(options.instruments,1)
|
for i = 1:size(options.instruments,1)
|
||||||
fprintf('\t %s \t %f \n',options.instruments(i,:),ys(strmatch(options.instruments(i,:),M.endo_names,'exact')))
|
fprintf('\t %s \t %f \n',options.instruments{i},ys(strmatch(options.instruments{i},M.endo_names,'exact')))
|
||||||
end
|
end
|
||||||
fprintf('evaluate_steady_state: The problem occured in the following equations: \n')
|
fprintf('evaluate_steady_state: The problem occured in the following equations: \n')
|
||||||
fprintf('\t Equation(s): ')
|
fprintf('\t Equation(s): ')
|
||||||
|
@ -168,7 +168,7 @@ if options.ramsey_policy
|
||||||
fprintf('\nevaluate_steady_state: The steady state computation for the Ramsey problem resulted in NaNs in the auxiliary equations.\n')
|
fprintf('\nevaluate_steady_state: The steady state computation for the Ramsey problem resulted in NaNs in the auxiliary equations.\n')
|
||||||
fprintf('evaluate_steady_state: The steady state computation resulted in the following instrument values: \n')
|
fprintf('evaluate_steady_state: The steady state computation resulted in the following instrument values: \n')
|
||||||
for i = 1:size(options.instruments,1)
|
for i = 1:size(options.instruments,1)
|
||||||
fprintf('\t %s \t %f \n',options.instruments(i,:),ys(strmatch(options.instruments(i,:),M.endo_names,'exact')))
|
fprintf('\t %s \t %f \n',options.instruments{i},ys(strmatch(options.instruments{i},M.endo_names,'exact')))
|
||||||
end
|
end
|
||||||
fprintf('evaluate_steady_state: The problem occured in the following equations: \n')
|
fprintf('evaluate_steady_state: The problem occured in the following equations: \n')
|
||||||
fprintf('\t Auxiliary equation(s): ')
|
fprintf('\t Auxiliary equation(s): ')
|
||||||
|
@ -186,7 +186,7 @@ if options.ramsey_policy
|
||||||
fprintf('\nevaluate_steady_state: The steady state for the Ramsey problem could not be computed.\n')
|
fprintf('\nevaluate_steady_state: The steady state for the Ramsey problem could not be computed.\n')
|
||||||
fprintf('evaluate_steady_state: The steady state computation stopped with the following instrument values:: \n')
|
fprintf('evaluate_steady_state: The steady state computation stopped with the following instrument values:: \n')
|
||||||
for i = 1:size(options.instruments,1)
|
for i = 1:size(options.instruments,1)
|
||||||
fprintf('\t %s \t %f \n',options.instruments(i,:),ys(strmatch(options.instruments(i,:),M.endo_names,'exact')))
|
fprintf('\t %s \t %f \n',options.instruments{i},ys(strmatch(options.instruments{i},M.endo_names,'exact')))
|
||||||
end
|
end
|
||||||
fprintf('evaluate_steady_state: The following equations have non-zero residuals: \n')
|
fprintf('evaluate_steady_state: The following equations have non-zero residuals: \n')
|
||||||
for ii=1:n_multipliers
|
for ii=1:n_multipliers
|
||||||
|
|
Loading…
Reference in New Issue