help-octave
[Top][All Lists]
Advanced

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

Re: "Exact" jacobian calculation


From: Søren Hauberg
Subject: Re: "Exact" jacobian calculation
Date: Sun, 02 Oct 2011 09:46:00 +0200

søn, 02 10 2011 kl. 06:05 +0300, skrev Fotios:
> I attach a simple function with the hope that someone will find it 
> useful. It calculates the "exact" jacobian of an analytic function 
> f:R^n->R^n avoiding subtractive cancellation by following the imaginary 
> step approach. Any corrections are welcomed. Enjoy.

This looks interesting (you should consider finding a place for it in
Octave-Forge). Two comments:

* I think you should pre-allocate 'Df' before the loop.
* Instead of writing 'Df = Df  / h' you can write 'Df /= h', which might
be faster.

I have never heard of the Complex Step Method, but it seems similar to
finite differences. Does it make sense have different magnitudes for
different coordinates (i.e. to let 'h' be a vector rather than a single
number) ? (I'm asking out of ignorance)

Søren



reply via email to

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