Add randomness in the initial guess for the growth factors.
parent
5e3603a1b6
commit
c1ec097ea0
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue