Commit cc0d9b42 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Changed name of options_.maxit as options_.simul.maxit.

parent 28740370
......@@ -37,7 +37,7 @@ if options.block && ~options.bytecode
else
n = length(M.block_structure_stat.block(b).variable);
[ss, check] = solve_one_boundary([M.fname '_static_' int2str(b)], ss, exo, ...
params, [], M.block_structure_stat.block(b).variable, n, 1, 0, b, 0, options.maxit_, ...
params, [], M.block_structure_stat.block(b).variable, n, 1, 0, b, 0, options.simul.maxit, ...
options.solve_tolf, ...
options.slowc, 0, options.solve_algo, 1, 0, 0,M,options);
if check
......
......@@ -50,7 +50,7 @@ if isempty(initial_conditions)
end
% Set maximum number of iterations for the deterministic solver.
options_.maxit_ = options_.ep.maxit;
options_.simul.maxit = options_.ep.maxit;
% Set the number of periods for the perfect foresight model
periods = options_.ep.periods;
......
......@@ -224,7 +224,7 @@ function [flag,endo_simul,err] = solve_stochastic_perfect_foresight_model(endo_s
fprintf('\n') ;
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
fprintf('\n') ;
disp(['WARNING : maximum number of iterations is reached (modify options_.maxit_).']) ;
disp(['WARNING : maximum number of iterations is reached (modify options_.simul.maxit).']) ;
fprintf('\n') ;
end
flag = 1;% more iterations are needed.
......
......@@ -274,7 +274,7 @@ function [flag,endo_simul,err] = solve_stochastic_perfect_foresight_model_1(endo
fprintf('\n') ;
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
fprintf('\n') ;
disp(['WARNING : maximum number of iterations is reached (modify options_.maxit_).']) ;
disp(['WARNING : maximum number of iterations is reached (modify options_.simul.maxit).']) ;
fprintf('\n') ;
end
flag = 1;% more iterations are needed.
......
......@@ -93,14 +93,14 @@ it_init = M_.maximum_lag+1;
info.convergence = 1;
info.time = 0;
info.error = 0;
info.iterations.time = zeros(options_.maxit_,1);
info.iterations.time = zeros(options_.simul.maxit,1);
info.iterations.error = info.iterations.time;
last_line = options_.maxit_;
last_line = options_.simul.maxit;
error_growth = 0;
h1 = clock;
for iter = 1:options_.maxit_
for iter = 1:options_.simul.maxit
h2 = clock;
if options_.terminal_condition
c = zeros(ny*(periods+1),nrc);
......
......@@ -66,7 +66,7 @@ pfm.i_cols_j = 1:pfm.nd;
pfm.i_upd = pfm.ny+(1:pfm.periods*pfm.ny);
pfm.dynamic_model = str2func([DynareModel.fname,'_dynamic']);
pfm.verbose = DynareOptions.ep.verbosity;
pfm.maxit_ = DynareOptions.maxit_;
pfm.maxit_ = DynareOptions.simul.maxit;
pfm.tolerance = DynareOptions.dynatol.f;
if nargin>3 && DynareOptions.ep.stochastic.order
......
......@@ -82,7 +82,7 @@ res = zeros(periods*ny,1);
h1 = clock ;
for iter = 1:options_.maxit_
for iter = 1:options_.simul.maxit
h2 = clock ;
i_rows = 1:ny;
......@@ -156,11 +156,11 @@ elseif ~stop
skipline();
fprintf('\nSimulation terminated after %d iterations.\n',iter);
fprintf('Total time of simulation : %10.3f\n',etime(clock,h1));
fprintf('WARNING : maximum number of iterations is reached (modify options_.maxit_).\n') ;
fprintf('WARNING : maximum number of iterations is reached (modify options_.simul.maxit).\n') ;
oo_.deterministic_simulation.status = 0;% more iterations are needed.
oo_.deterministic_simulation.error = err;
%oo_.deterministic_simulation.errors = c/abs(err)
oo_.deterministic_simulation.iterations = options_.maxit_;
oo_.deterministic_simulation.iterations = options_.simul.maxit;
end
disp (['-----------------------------------------------------']) ;
skipline();
......
......@@ -58,7 +58,7 @@ fprintf('\n') ;
it_init = M_.maximum_lag+1 ;
h1 = clock ;
for iter = 1:options_.maxit_
for iter = 1:options_.simul.maxit
h2 = clock ;
if options_.terminal_condition == 0
......@@ -121,12 +121,12 @@ if ~stop
fprintf('\n') ;
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
fprintf('\n') ;
disp(['WARNING : maximum number of iterations is reached (modify options_.maxit_).']) ;
disp(['WARNING : maximum number of iterations is reached (modify options_.simul.maxit).']) ;
fprintf('\n') ;
oo_.deterministic_simulation.status = 0;% more iterations are needed.
oo_.deterministic_simulation.error = err;
oo_.deterministic_simulation.errors = c/abs(err);
oo_.deterministic_simulation.iterations = options_.maxit_;
oo_.deterministic_simulation.iterations = options_.simul.maxit;
end
disp (['-----------------------------------------------------']) ;
......@@ -192,9 +192,9 @@ for it_=start:incr:finish
continue;
else
if(cutoff == 0)
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.maxit_".\n',Block_Num, it_, iter);
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.simul.maxit".\n',Block_Num, it_, iter);
else
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.maxit_" or set "cutoff=0" in model options.\n',Block_Num, it_, iter);
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.simul.maxit" or set "cutoff=0" in model options.\n',Block_Num, it_, iter);
end;
if(is_dynamic)
oo_.deterministic_simulation.status = 0;
......@@ -397,9 +397,9 @@ for it_=start:incr:finish
end
if cvg==0
if(cutoff == 0)
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.maxit_\".\n',Block_Num, it_,iter);
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.simul.maxit\".\n',Block_Num, it_,iter);
else
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.maxit_" or set "cutoff=0" in model options.\n',Block_Num, it_,iter);
fprintf('Error in simul: Convergence not achieved in block %d, at time %d, after %d iterations.\n Increase "options_.simul.maxit" or set "cutoff=0" in model options.\n',Block_Num, it_,iter);
end;
if(is_dynamic)
oo_.deterministic_simulation.status = 0;
......
......@@ -96,7 +96,7 @@ function [flag,endo_simul,err] = solve_perfect_foresight_model(endo_simul,exo_si
fprintf('\n') ;
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
fprintf('\n') ;
disp(['WARNING : maximum number of iterations is reached (modify options_.maxit_).']) ;
disp(['WARNING : maximum number of iterations is reached (modify options_.simul.maxit).']) ;
fprintf('\n') ;
end
flag = 1;% more iterations are needed.
......
......@@ -133,9 +133,9 @@ while ~(cvg==1 || iter>maxit_),
continue;
else
if(cutoff == 0)
fprintf('Error in simul: Convergence not achieved in block %d, after %d iterations.\n Increase "options_.maxit_".\n',Block_Num, iter);
fprintf('Error in simul: Convergence not achieved in block %d, after %d iterations.\n Increase "options_.simul.maxit".\n',Block_Num, iter);
else
fprintf('Error in simul: Convergence not achieved in block %d, after %d iterations.\n Increase "options_.maxit_" or set "cutoff=0" in model options.\n',Block_Num, iter);
fprintf('Error in simul: Convergence not achieved in block %d, after %d iterations.\n Increase "options_.simul.maxit" or set "cutoff=0" in model options.\n',Block_Num, iter);
end;
oo.deterministic_simulation.status = 0;
oo.deterministic_simulation.error = max_res;
......
......@@ -707,9 +707,9 @@ main(int nrhs, const char *prhs[])
DYN_MEX_FUNC_ERR_MSG_TXT("verbosity is not a field of options_");
if (verbose)
print_it = true;
field = mxGetFieldNumber(options_, "maxit_");
field = mxGetFieldNumber(options_, "simul.maxit");// Not sure of that...
if (field < 0)
DYN_MEX_FUNC_ERR_MSG_TXT("maxit_ is not a field of options_");
DYN_MEX_FUNC_ERR_MSG_TXT("simul.maxit is not a field of options_");
int maxit_ = int (floor(*(mxGetPr(mxGetFieldByNumber(options_, 0, field)))));
field = mxGetFieldNumber(options_, "slowc");
if (field < 0)
......
......@@ -4,7 +4,7 @@ fid = fopen([M_.fname '_options.txt'],'wt');
if steady_state~=1
fprintf(fid,'%d\n',options_.periods);
end;
fprintf(fid,'%d\n',options_.maxit_);
fprintf(fid,'%d\n',options_.simul.maxit);
fprintf(fid,'%6.20f\n',options_.slowc);
fprintf(fid,'%6.20f\n',options_.markowitz);
fprintf(fid,'%6.20f\n',options_.dynatol.f);
......
......@@ -1889,7 +1889,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
<< " disp (['MODEL SIMULATION: (method=' mthd ')']) ;" << endl
<< " fprintf('\\n') ;" << endl
<< " periods=options_.periods;" << endl
<< " maxit_=options_.maxit_;" << endl
<< " maxit_=options_.simul.maxit;" << endl
<< " solve_tolf=options_.solve_tolf;" << endl
<< " y=oo_.endo_simul';" << endl
<< " x=oo_.exo_simul;" << endl;
......@@ -1988,7 +1988,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " y = solve_one_boundary('" << dynamic_basename << "_" << block + 1 << "'"
<<", y, x, params, steady_state, y_index, " << nze
<<", options_.periods, " << blocks_linear[block]
<<", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
<<", blck_num, y_kmin, options_.simul.maxit, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if any(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
......@@ -2018,7 +2018,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " y = solve_one_boundary('" << dynamic_basename << "_" << block + 1 << "'"
<<", y, x, params, steady_state, y_index, " << nze
<<", options_.periods, " << blocks_linear[block]
<<", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
<<", blck_num, y_kmin, options.simul.maxit, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if any(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
......@@ -2048,7 +2048,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
<<", options_.periods, " << max_leadlag_block[block].first
<<", " << max_leadlag_block[block].second
<<", " << blocks_linear[block]
<<", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo);\n";
<<", blck_num, y_kmin, options_.simul.maxit, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if any(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
......
......@@ -60,7 +60,7 @@ k=k+0.000001;
end;
options_.dynatol.f=1e-12;
options_.maxit_=5;
options_.simul.maxit=5;
options_.slowc=1;
steady(solve_algo=2);
......@@ -72,7 +72,7 @@ periods 1;
values 0.02;
end;
options_.maxit_=20;
options_.simul.maxit=20;
model_info;
simul(periods=2000, stack_solve_algo = 0);
......
......@@ -63,7 +63,7 @@ var e_ys = 1.89;
var e_pies = 1.89;
end;
options_.maxit_=100;
options_.simul.maxit=100;
steady(solve_algo = @{solve_algo});
@#if block
......
......@@ -43,7 +43,7 @@ set_dynare_seed('default');
stoch_simul(order=2,pruning,irf=0,periods=5000);
y_perturbation_2_pruning = oo_.endo_simul(1,:)';
options_.maxit_ = 100;
options_.simul.maxit = 100;
options_.ep.verbosity = 0;
options_.ep.stochastic.order = 0;
options_.ep.stochastic.nodes = 2;
......
......@@ -26,7 +26,7 @@ end;
steady;
options_.maxit_ = 100;
options_.simul.maxit = 100;
options_.ep.verbosity = 0;
options_.ep.stochastic.status = 0;
options_.ep.order = 0;
......@@ -42,4 +42,4 @@ sts = extended_path([],100);
if max(max(abs(ts-sts))) > 1e-12
error('extended path algorithm fails in ./tests/ep/linear.mod')
end
\ No newline at end of file
end
......@@ -68,7 +68,7 @@ copyfile('rbcii_steady_state.m','rbcii_steadystate2.m');
steady(nocheck);
options_.maxit_ = 100;
options_.simul.maxit = 100;
options_.ep.verbosity = 0;
options_.ep.stochastic.order = 0;
options_.ep.stochastic.nodes = 2;
......@@ -91,7 +91,7 @@ copyfile('rbcii_steady_state.m','rbcii_steadystate2.m');
steady;//(nocheck);
options_.maxit_ = 100;
options_.simul.maxit = 100;
simul(periods=4000);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment