Hi R-list, I'd like to extract the psuedo model matrix (derivative of fitted values wrt the parameters) from an nls object. Any suggestions? Thanks, Murray Jorgensen Dr Murray Jorgensen on leave from: Mathematics and Statistics Department of Statistics University of Victoria University of Waikato PO BOX 3045 STN CSC Hamilton, New Zealand Victoria, B.C. Email: maj at waikato.ac.nz Canada V8W 3P4 Phone: (250) 721-7460 wk (250) 477 2581 home -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Murray Jorgensen <maj at waikato.ac.nz> writes:> Hi R-list, > > I'd like to extract the psuedo model matrix (derivative of fitted > values wrt the parameters) from an nls object. > > Any suggestions?The short answer is fm$m$gradient() when your fitted nls model is called fm. The longer answer is that the component m in a fitted nls model object is a list of functions that share a function closure. The function closure contains the data and other information about the fit. One of those functions is called gradient. Calling that function either returns the precalculated gradient or, if necessary, evaluates and returns the gradient. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._