Forward-difference numerical Jacobian of a (possibly nested-output) function with respect to one or more of its arguments. Mirrors SPM25's dcm_diff.

dcm_diff(...)

Arguments

...

Function, its arguments, the index (or vector of indices) of the argument(s) to differentiate with respect to, and optionally a list of projection matrices.

Value

A list containing the Jacobian J (or higher-order derivatives) and the function value f0.