Discussion:
Tips to speedup lsqnonlin ?
Info
2018-11-19 19:14:19 UTC
Permalink
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.
Olaf Till
2018-11-23 07:25:06 UTC
Permalink
Post by Info
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.

Olaf
--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net
Info
2018-11-28 16:40:10 UTC
Permalink
Post by Olaf Till
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.
Loading...