[R] What does this warning message (from optim function) mean?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Aug 25 20:37:17 CEST 2010
You mean 'TRUE': 'T' is a variable in R, with initial value TRUE.
On Wed, 25 Aug 2010, Sally Luo wrote:
> Hi R users,
> I am trying to use the optim function to maximize a likelihood funciton, and
> I got the following warning messages.
> Could anyone explain to me what messege 31 means exactly? Is it a cause for
> concern?
> Since the value of convergence turns out to be zero, it means that the
> converging is successful, right?
> So can I assume that the parameter estimates generated thereafter are
> reliable MLE estimates?
> Thanks a lot for your help.
>
> Maomao
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> p<-optim(c(0,0,0), f, method ="BFGS", hessian =T, y=y,X=X,W=W)
>
> There were 31 warnings (use warnings() to see them)
>
>> warnings()
>
> Warning messages:
>
> 1: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 2: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 3: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 4: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 5: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 6: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 7: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 8: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 9: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 10: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 11: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 12: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 13: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 14: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 15: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 16: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 17: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 18: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 19: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 20: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 21: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 22: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 23: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 24: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 25: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 26: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 27: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 28: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 29: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 30: In log(det(I_N - pd * wd - po * wo - pw * ww)) : NaNs produced
>
> 31: In if (hessian) { ... :
>
> the condition has length > 1 and only the first element will be used
>
>> p$counts
>
> function gradient
>
> 148 17
>
>> p$convergence
>
> [1] 0
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list