On Wed, 18 May 2005, Spencer Graves wrote:
1. If the function you ask nlminb to minimize is the deviance,
then that's included in the function output. I haven't tried this recently,
but I believe I used to use constructs like the following:
fit <- nlminb(...)
Then "fit$objective" should be the value of the objective function
at the optimum.
2. Parameter correlations are not so easy with nlminb. Instead, I
use "fit <- optim(..., hessian=T)" in library(MASS). If your objective
function is the deviance, then 0.5*fit$hessian should be the inverse of the
negative of the observed information matrix. I routinely compute
eigen(0.5*fit$hessian, symmetric=TRUE) to check if it is of full rank. If
it's not, the problem is overparameterized and you can't estimate everything
-- or you need better starting values. If the hessian is of full rank, then
its inverse provides the covariance matrix of the standard normal
approximation to the distribution of fit$par. From that, you can compute the
correlation matrix by dividing rows and columns by the product of the square
roots of the diagonal elements.
It seems little known that vcov.nlminb in MASS does make them easy. The
only documentation is in the book (MASS, 4th edition, p.439).
yiwu ye wrote:
Dear list,
I am using nlminb to estimate model parameters. How
can I get deviance of the fit and parameter
correlation information?
Many thanks for your help,
Yiwu
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
|