Add randomness in the initial guess for the growth factors.

bgp-dev
Stéphane Adjemian (Ryûk) 2022-10-06 12:56:54 +02:00
parent 5e3603a1b6
commit c1ec097ea0
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 2 additions and 2 deletions

View File

@ -56,14 +56,14 @@ verbatim;
reverseStr = '';
for i=1:MC
y = 1+(rand(6,1)-.5)*.2;
g = ones(6,1);
g = ones(6,1)+.05*randn(6,1);
[y, fval, exitflag] = fsolve(@solow.bgpfun, [y;g], options);
if exitflag>0
KY(i) = y(6)/y(5);
GY(i) = y(11);
GK(i) = y(12);
EG(i) = y(2);
end
end
% Display the progress
percentDone = 100 * i / MC;
msg = sprintf('Percent done: %3.1f', percentDone);