Compute gradient from residuals and Jacobian.

Share:

Description

For a nonlinear model originally expressed as an expression of the form
lhs ~ formula_for_rhs
assume we have a resfn and jacfn that compute the residuals and the
Jacobian at a set of parameters. This routine computes the gradient,
that is, t(Jacobian) . residuals.