Skip to content

messages from mle function

2 messages · bernardo lagos alvarez, Brian Ripley

#
Dears useRs,
I am using the mle function but this gives me the follow erros that I
don't understand. Perhaps there is someone that can help me.

thank you for you atention.

Bernardo.
EDAD TALLA
1    0   7.7
2    1  14.5
3    1  16.9
4    1  13.2
5    1  24.4
6    1  22.5
+ edad  <- erizo$EDAD
+ LT    <- erizo$TALLA
+ N     <- length(edad)
+ sigma <- sum((LT - TAN(edad,f,c,a,d))^2) / N
+ logl  <- (N/2)*log(sigma) + (sum((LT - TAN(edad,f,c,a,d))^2) / (2*sigma))
+ }
Nelder-Mead direct search function minimizer
function value for initial parameters = 1159.477620
  Scaled convergence tolerance is 1.72776e-05
Stepsize computed as 84.671790
BUILD              5 3165.307359 1159.477620
.
.
.
HI-REDUCTION     303 1158.377359 1158.377314
LO-REDUCTION     305 1158.377339 1158.377303
LO-REDUCTION     307 1158.377321 1158.377303
Exiting from Nelder Mead minimizer
    309 function evaluations used
Error en optim(start, f, method = method, hessian = TRUE, ...) :
        non-finite finite-difference value [1]
Adem?s: Hubo 50 o  m?s avisos (use warnings() para ver los primeros 50)
#
This is not reproducible, so I am reduced to guessing.

Your loglike() is only defined for positive f, but you have not imposed 
that constraint on your optimization.  Further, if f=5.91e-05 is a typical 
value, your problem is badly conditioned and the finite difference code in 
optim() is likely to step outside the undeclared region of validity.

I suggest that you

- study the help page for optim()
- make use of the control parameters to scale the problem suitably
- either impose the positivity constraint via the L-BFGS-B method, or
   transform f to a suitable scale, e.g. by making log(f) the parameter.
On Tue, 11 Mar 2008, bernardo lagos alvarez wrote:

            
You could look at the many warnings -- they may well tell you the 
underlying problem.