[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tips to speedup lsqnonlin ?

From: Olaf Till
Subject: Re: Tips to speedup lsqnonlin ?
Date: Fri, 23 Nov 2018 08:25:06 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Nov 19, 2018 at 07:14:19PM +0000, Info wrote:
> My code runs hundreds of iterations of lsqnonlin and some iterations can take 
> a minute or more to finish. Are there any general tips to make it run faster? 
> The same code in Matlab is around 40% faster. 
> I am wondering if there is anything worth trying with parallelizing? My 
> machine has 40 cpus but octave is only using one cpu.

Giving it an explicit Jacobian function (which doesn't use finite
differencing) usually will make it faster.

You can experiment with FinDiffRelStep and TypicalX.

Setting FinDiffType to "forward" can make it faster in some cases.

lsqnonlin wraps nonlin_residmin. nonlin_residmin can parallelize
automatic Jacobioan computation by finite differences; an option has
to be set for this and the 'parallel' package has to be installed. If
you are on Windows, however, the parallel package can't be installed.


public key id EAFE0591, e.g. on x-hkp://

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]