R: Utility functions for creating Gradient- and Hessian-like...
makeDerivs
R Documentation
Utility functions for creating Gradient- and Hessian-like matrices with symbolic derivatives and evaluating them in an environment
Description
These are three different utility functions that create matrices containing the symbolic partial derivatives of first (makeGrad) and second (makeHess) order and a function for evaluating these matrices in an environment. The evaluations of the symbolic derivatives are used within the propagate function to calculate the propagated uncertainty, but these functions may also be useful for other applications.
Usage
makeGrad(expr, order = NULL)
makeHess(expr, order = NULL)
evalDerivs(deriv, envir)
Arguments
expr
an expression, such as expression(x/y).
order
order of creating partial derivatives, i.e. c(2, 1). See 'Examples'.
deriv
a matrix returned from makeGrad or makeHess.
envir
an environment to evaluate in. By default the workspace.
Details
Given a function f(x_1, x_2, …, x_n), the following matrices containing symbolic derivatives of f are returned: