[R] How robust is mle in R?

Charles H. Franklin franklin at polisci.wisc.edu
Sun Jul 13 22:30:18 CEST 2003


  The R "optim" function is what you probably want to read up on for ML in
R. It may or may not be less "complaining" than the Stata ML functions.
Optim provides several alternative algorithms which may help you find one
that is best for your problem. On the other hand, it sounds like you have a
difficult likelihood and/or recalcitrant data.  It seems likely that your
likelihood and data are going to cause more problems than are due to any
peculiarities of the algorithms in Stata OR R. No magic bullets in either,
of course. For what it is worth, I've not managed to "break" the optim
function in R.

Comparatively, I think the Stata ML functions make access to the variables
and specification of the model a little easier and require fewer lines of
code. Stata also then provides standard post estimation commands for the ML
results. R (optim, actually) will return an object with the usual components
that you can also use for any post estimation purposes. But in R you'll
probably write a few more lines of code to specify the model and manipulate
the returned results. You probably need to learn a bit more to program this
effectively in R than you need to learn to do the same thing in Stata. Also,
Stata's "ml check" provides a nice test of your code before you loose it on
the data!

Gauss's "maxlik" routines would be another possibility, if you have or are
able to acquire Gauss.


** Charles H. Franklin
** Professor, Political Science
** University of Wisconsin, Madison
** 1050 Bascom Mall
** Madison, WI 53706
** 608-263-2022 Office
** 608-265-2663 Fax
** mailto:franklin at polisci.wisc.edu (best)
** mailto:chfrankl at facstaff.wisc.edu (alt)
** http://www.polisci.wisc.edu/~franklin

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Peter Muhlberger
Sent: Sunday, July 13, 2003 9:55 AM
To: rhelp
Subject: [R] How robust is mle in R?

A newbie question:  I'm trying to decide whether to run a maximum likelihood
estimation in R or Stata and am wondering if the R mle routine is reasonably
robust.  I'm fairly certain that, with this data, in Stata I would get a lot
of complaints about non-concave functions and unproductive steps attempted,
but would eventually have a successful ML estimate.  I believe that, with
the 'unproductive step' at least, Stata gets around the problem by switching
to some alternative estimation method in difficult cases.  Does anyone know
how robust mle is in R?


R-help at stat.math.ethz.ch mailing list

More information about the R-help mailing list