Jacobian function?

455 views
Skip to first unread message

Sam Urmy

unread,
Feb 11, 2014, 4:35:45 PM2/11/14
to julia...@googlegroups.com
I imagine this exists somewhere already, but I haven't been able to find it: is there a function that takes a vector-valued function and a point in its domain, and returns the Jacobian matrix at that point?

Thanks~

Sam

Mauro

unread,
Feb 11, 2014, 5:25:20 PM2/11/14
to julia...@googlegroups.com
You could try automatic differentiation. Have a look at the example in
the readme of https://github.com/scidom/DualNumbers.jl

Miles Lubin

unread,
Feb 11, 2014, 9:34:30 PM2/11/14
to julia...@googlegroups.com
We're still in the process of putting together a nice interface for this, but automatic differentiation is a good option that isn't available in most other languages. It will give you an *exact* numerical derivative, not subject to approximation error from finite differences. As an example of how to use the DualNumbers package to compute a Jacobian matrix, see https://github.com/EconForge/NLsolve.jl/pull/6. If you have any questions on this, I'm happy to help out.

As a fallback, the Calculus package has routines for computing a Jacobian using finite differences.

Sam Urmy

unread,
Feb 11, 2014, 11:19:09 PM2/11/14
to julia...@googlegroups.com
Wow, very cool.  I learned something new today...

Miles, in autodiff.jl, are the function arguments all modified in place just to save memory in the case of large vectors, or is there some other reason?

Miles Lubin

unread,
Feb 12, 2014, 9:52:17 AM2/12/14
to julia...@googlegroups.com
The function arguments are modified in place for efficiency reasons, to avoid temporary allocations. This isn't needed in principle.
Reply all
Reply to author
Forward
0 new messages