[R] Non-Linear Optimization - Query
Berend Hasselman
bhh at xs4all.nl
Wed Mar 18 20:43:07 CET 2009
On 18-03-2009, at 18:36, Ravi Varadhan wrote:
>>
>> system.time(ans.nl <- nleqslv(x=p0, fn=broydt))[1]
> user.self
> 8.17
On my Imac 2.16Ghz and R 2.8.1 and Mac OS X 10.5.6
this took approximately 5 seconds.
Interesting is this experiment.
I set the jacobian for a starting point with all x-values equal to -1
to a diagonal matrix with 7 on the diagonal
(not a bad approximation).
Solving the 1000 equation system now takes 1.4 seconds on my computer
with Broyden and double dogleg in 26 iterations
(only 1 jacobian is needed in the first iteration).
So the overhead of calculating the initial jacobian appears to be a
bottleneck.
Berend
More information about the R-help
mailing list