[R] a question about gradient in optim

From: Mehmet Balcilar <mbalcilar_at_gmail.com>
Date: Tue 23 May 2006 - 18:01:17 EST


Hi,

I am using optim to estimate the parameters of a smooth transition autoregressive model. I wrote a function to return the gradient for each observation. So, for k parameters and n observations my function returns a (n x k) matrix. The gr argument of optim expects a (k x 1) vector. Now, what is the correct way of passing my gradient matrix to optim?

Mehmet



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 23 18:08:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 23 May 2006 - 20:10:19 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.