Usage: |
z = nmgraditer(func, x0{, h})
|
Input: |
| func | name of function (string) whose gradient is to be
computed. The function 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 is to
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;
(h need not to be very small)
default value is 0.001
|
Output: |
| z.grad | n x 1 vector, computed gradient |
| z.err | n x 1 vector, estimates of errors of partial derivatives |
| z.hfin | n x 1 vector, stepsizes for partial derivatives in last iteration |