Skip to content
Prev 80953 / 398502 Next

numericDeriv

(Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> writes:
Oho. That had me baffled for a while... We should probably also
explain that x is a vector and differentiation of a vector w.r.t. a
vector is a matrix. If you want a 5x1 result you should likely use
something like
[1]  1  4  9 16 25
attr(,"gradient")
     [,1]
[1,]    2
[2,]    4
[3,]    6
[4,]    8
[5,]   10

(I *hope* there's no way to get the result that Florent claims that he
expected...)