Usage: |
jacobi = nmjacobian(func, x0{, h, iter})
|
Input: |
| func | name of function(s) (string or vector of strings)
whose gradient matrix (jacobian) is to be
computed. The function(s) should take just one
parameter x, which is n x k matrix (k >= 1)
x = (x1,x2,...,xk); xi (n x 1 vector; i=1..k)
represent points in which the function should be
evaluated. As a result, the function should return
k real numbers in a form of 1 x k vector.
|
| x0 | n x 1 vector, the point at which gradient(s) will
be computed
|
| h | optional n x 1 vector or scalar (in the latter case,
h <- h * matrix(n) will be used);
vector of initial stepsizes for partial derivatives;
if not given, default value of gradient quantlet
will be used
|
| iter | optional number, controls usage of iterative/difference
method for computing gradient;
if iter is not given or iter = 0, difference method
nmgraddiff will be used (quicker), otherwise
iterative method nmgraditer will be used (more precise)
|
Output: |
| jacobi | dim(func) x n matrix, i-th row containes the gradient
of i-th function (it is jacobian for dim(func) = n) |