Hi Ashley,
Because the log-likelihood has terms log(gamma) and gamma^(-1), you want to
set your lower-bound to a non-zero positive number. 0.1^3 , 0.1^4 or
whatever should work.
Best,
Carl
On Wed, Apr 7, 2010 at 11:25 PM, Ashley Anderson
<aaanders at fas.harvard.edu>wrote:
I found the log likelihood for problem 2A but
I'm having problems with my
optim function. My function reads as follows:
*y.vec <- data2$yearsinoffice
optim(par = .2, fn = mle, y = y.vec, control = list(fnscale = -1), method =
"L-BFGS-B", lower = 0, upper = Inf, hessian = TRUE)
*
But I get the following error:
*Error in optim(par = 0.2, fn = mle, y = y.vec, control = list(fnscale =
-1), :
L-BFGS-B needs finite values of 'fn'
*
Can anyone offer some advice?
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l