Can you send us some code for the log-likelihood
function? If I had to
guess I would say that you left a factorial of y in there. This becomes an
incredibly large number and overloads the program. That's why you have to
simplify that stuff out.
Brandon
On Wed, Mar 30, 2011 at 5:50 PM, Adela Soliz <ars431(a)mail.harvard.edu>wrote;wrote:
Thanks, Sean, but I have that. This is my optim
command:
optim(par=c(rep(0,10)), y=y, X=X, Z=Z, fn=zero.poiss,
control=list(fnscale=-1), method="BFGS", hessian=TRUE)
On Wed, Mar 30, 2011 at 4:47 PM, Sean Ingham <stingham(a)gmail.com> wrote:
I think you left out this argument,
control=list(fnscale = -1)
which tells optim to look for the minimum of the negative of your
function zero.poiss, i.e., its maximum. If you omit it, optim will look for
the minimum of your function, which presumably doesn't exist.
Sean
On Wed, Mar 30, 2011 at 4:38 PM, Adela Soliz <ars431(a)mail.harvard.edu>wrote;wrote:
> Hi Class,
>
> I keep receiving this message when I try to optimize my function in
> problem 2.4:
>
> Error in optim(par = rep(0, 8), y = y, X = X, Z = Z, fn = zero.poiss,
> :
> non-finite finite-difference value [6]
>
> I've checked my function to make sure all the parts of it are working
> correctly, I've tried changing things in optim. I think we talked about
> this error is section once- can anyone tell me what's going on?
>
> -Adela
>
> _______________________________________________
> gov2001-l mailing list
> gov2001-l(a)lists.fas.harvard.edu
>
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>
>
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu