Skip to content

MLEs using optim

2 messages · djbanana, Rolf Turner

#
I am trying to use the optim command to get the MLEs for a number of
parameters based on some data. Is it possible to write a program that
maximizes the likelihood and stores the parameters (many times)? I need to
do this a lot of times, each time the data will be updated with more entries
(rows). I need to see how the new data is affecting the previous parameter
estimates of the model. What is the best way to do it?

Thanks.

--
View this message in context: http://r.789695.n4.nabble.com/MLEs-using-optim-tp4361361p4361361.html
Sent from the R help mailing list archive at Nabble.com.
#
On 07/02/12 03:24, djbanana wrote:
Of course it's possible.  This is R.
(1) Preallocate a list to hold the results.

(2) Use a for loop.

(3) Remember to use *double* brackets (``[[ ]]'') when assigning
a value to the i-th entry of your pre-defined list.

(4) For efficiency it is probably best to use the estimates returned
at step i as the starting values for step i+1.

     cheers,

         Rolf Turner