From bolker at zoo.ufl.edu  Tue Oct 31 15:50:06 2006
From: bolker at zoo.ufl.edu (Ben Bolker)
Date: Tue, 31 Oct 2006 09:50:06 -0500
Subject: [Rd] help with extended mle package?
Message-ID: <4547629E.5030405@zoo.ufl.edu>


  A while back, I wrote to the list/engaged in some debate with
Peter Dalgaard about the mle() function in the stats4 package --
in particular, I wanted it to have a data= argument so that
parameters could be estimated for different sets of data with
the same minuslogl function: Peter disagreed, suggesting that
a function-defining-function (e.g. something like

minusloglfun <- function(data) {
   with(data,
      function(param1,param2) {
         [negative log-likelihood expression]
      })
) was a good solution.

  I also had some confusion/misunderstanding about the differences
between the fullcoef and coef slots within the mle object.

  Since then I've done a fair amount with my version
of mle()  [bbmle, available from
http://www.zoo.ufl.edu/bolker/R/src/bbmle_0.3.0.tar.gz ] ;


 - confidence limits estimated by spline back-fitting
(as in base mle package) OR uniroot (for higher precision/
models with non-smooth profiles) OR quadratic approximation

 - allows parameters to be specified as a named vector
rather than a named list (so you can in principle use the
same objective function for optim() or mle())

 - options for profile plots

 - anova method for mle to produce Likelihood Ratio Test
tables

 - AIC, BIC methods for single and multiple models

 - some robustness -- e.g. continues with more informative
messages if (e.g.) Hessian can't be inverted or profile
finds better fit

  I'm afraid, however, that my code is now getting somewhat
idiosyncratic and spaghetti-ish -- I ran into this particularly
when trying to add some options to the AIC method to allow
(e.g.) small-sample corrections or calculation of AIC weights
a la Burnham and Anderson.

  I did have the original goal of also extending mle in the
direction of allowing more analytic expressions for parameters
of known distributions (like Jim Lindsey's packages, but ideally (?)
more robust), but I haven't gotten there yet.  My main goal
is to make mle a practical, robust and convenient tool for
analysis ... in the long run I would love it if at least
some of my changes got rolled back into stats4.

   Anyone out there interesting in hacking on this a bit more
with me/providing some perspective on which bells and whistles
are really necessary and which are unnecessary complications?

  cheers
    Ben Bolker


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20061031/3a1dc985/attachment-0004.bin 


[Rd] help with extended mle package?
Ben Bolker