[R] Non-Linear Optimization - Query

Paul Smith phhs80 at gmail.com
Wed Mar 18 20:54:56 CET 2009


On Wed, Mar 18, 2009 at 7:43 PM, Berend Hasselman <bhh at xs4all.nl> 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.

Thanks, Berend and Ravi. If you try with 10 000 variables, then
nleqslv seems to be running endlessly whereas with dfsane it takes
just 0.134 (same units as used by system.time).

Paul




More information about the R-help mailing list