Unverified Commit 47477e15 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Bump minimal Octave version to 6.2.0

parent c0ccca26
......@@ -7,7 +7,7 @@
*/
/*
* Copyright (C) 2019 Dynare Team
* Copyright (C) 2019-2021 Dynare Team
*
* This file is part of Dynare.
*
......@@ -72,14 +72,7 @@ verbatim;
else
options = optimoptions('fsolve','Display','iter','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-6,'StepTolerance',1e-6);
end
if isoctave && octave_ver_less_than('6')
% Octave < 6 can't take a function handle of a function in a package
% See https://savannah.gnu.org/bugs/index.php?46659
fun = str2func('fs2000.bgpfun');
else
fun = @fs2000.bgpfun;
end
[y, fval, exitflag] = fsolve(fun, [y;g], options);
[y, fval, exitflag] = fsolve(@fs2000.bgpfun, [y;g], options);
if exitflag<1
error('Solution not found')
end
......
......@@ -29,16 +29,9 @@ verbatim;
else
options = optimoptions('fsolve','Display','iter','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-8,'StepTolerance',1e-8);
end
if isoctave && octave_ver_less_than('6')
% Octave < 6 can't take a function handle of a function in a package
% See https://savannah.gnu.org/bugs/index.php?46659
fun = str2func('nk.bgpfun');
else
fun = @nk.bgpfun;
end
y = 1+(rand(3,1)-.5)*.5;
g = 1+(rand(3,1)-.5)*.1;
[y, fval, exitflag] = fsolve(fun, [y;g], options);
[y, fval, exitflag] = fsolve(@nk.bgpfun, [y;g], options);
assert(max(abs(y-1))<1e-9);
end;
......@@ -24,16 +24,9 @@ verbatim;
else
options = optimoptions('fsolve','Display','iter','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-6,'StepTolerance',1e-6);
end
if isoctave && octave_ver_less_than('6')
% Octave < 6 can't take a function handle of a function in a package
% See https://savannah.gnu.org/bugs/index.php?46659
fun = str2func('ramsey.bgpfun');
else
fun = @ramsey.bgpfun;
end
y = 1+(rand(M_.endo_nbr,1)-.5)*.25;
g = ones(M_.endo_nbr,1);% 1+(rand(M_.endo_nbr,1)-.5)*.1;
[y, fval, exitflag] = fsolve(fun, [y;g], options);
[y, fval, exitflag] = fsolve(@ramsey.bgpfun, [y;g], options);
assert(max(abs(y(M_.endo_nbr+(1:M_.orig_endo_nbr))-1.02))<1e-6)
end;
......@@ -55,18 +55,11 @@ verbatim;
else
options = optimoptions('fsolve','Display','off','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-8,'StepTolerance',1e-8);
end
if isoctave && octave_ver_less_than('6')
% Octave < 6 can't take a function handle of a function in a package
% See https://savannah.gnu.org/bugs/index.php?46659
fun = str2func('solow.bgpfun');
else
fun = @solow.bgpfun;
end
reverseStr = '';
for i=1:MC
y = 1+(rand(6,1)-.5)*.2;
g = ones(6,1);
[y, fval, exitflag] = fsolve(fun, [y;g], options);
[y, fval, exitflag] = fsolve(@solow.bgpfun, [y;g], options);
if exitflag>0
KY(i) = y(6)/y(5);
GY(i) = y(11);
......
......@@ -76,11 +76,7 @@ for i=1:nvar
SubsetOfVariables(i) = i_tmp;
end
if isoctave && octave_ver_less_than('6')
[observable_pos,index_observables,index_subset]=intersect_stable(SubsetOfVariables,options_.varobs_id);
else
[observable_pos,index_observables,index_subset]=intersect(SubsetOfVariables,options_.varobs_id,'stable');
end
[observable_pos,index_observables,index_subset]=intersect(SubsetOfVariables,options_.varobs_id,'stable');
y_pos=strmatch('y',var_list_,'exact');
y_pos_varobs=strmatch('y',options_.varobs,'exact');
a_pos_varobs=strmatch('a',options_.varobs,'exact');
......@@ -114,11 +110,7 @@ if max(abs(sum(oo_.variance_decomposition,2)-100))>2
error(['Variance decomposition at order ',num2str(options_.order),' does not work'])
end
if isoctave && octave_ver_less_than('6')
[observable_pos,index_observables,index_subset]=intersect_stable(SubsetOfVariables,options_.varobs_id);
else
[observable_pos,index_observables,index_subset]=intersect(SubsetOfVariables,options_.varobs_id,'stable');
end
[observable_pos,index_observables,index_subset]=intersect(SubsetOfVariables,options_.varobs_id,'stable');
y_pos=strmatch('y',var_list_,'exact');
y_pos_varobs=strmatch('y',options_.varobs,'exact');
a_pos_varobs=strmatch('a',options_.varobs,'exact');
......
......@@ -19,15 +19,8 @@ end;
steady;
check;
% Skip test under Octave 5.1
% ordeig() is buggy in that version (but is fixed in later ones; and in older
% ones it is absent, so we use our replacement)
if ~isoctave || octave_ver_less_than('5.1') || ~octave_ver_less_than('5.2')
stoch_simul(periods=0, irf=30, order=1);
stoch_simul(periods=2000, irf=30, order=1);
stoch_simul(periods=0, irf=30, order=1,hp_filter=1600);
stoch_simul(periods=2000, irf=30, order=1,hp_filter=1600);
end
......@@ -20,15 +20,8 @@ end;
steady;
check;
% Skip test under Octave 5.1
% ordeig() is buggy in that version (but is fixed in later ones; and in older
% ones it is absent, so we use our replacement)
if ~isoctave || octave_ver_less_than('5.1') || ~octave_ver_less_than('5.2')
stoch_simul(periods=0, irf=30, order=1);
stoch_simul(periods=2000, irf=30, order=1);
stoch_simul(periods=0, irf=30, order=1,hp_filter=1600);
stoch_simul(periods=2000, irf=30, order=1,hp_filter=1600);
end
Supports Markdown
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