[R] What does this warning message (from optim function) mean?

Ravi Varadhan rvaradhan at jhmi.edu
Wed Aug 25 22:20:22 CEST 2010


Hi,

You did not give us any information about your likelihood function, f, nor
did you provide a reproducible example.  So, I cannot tell for sure whether
the parameter estimates are reliable.

Ravi.

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Sally Luo
Sent: Wednesday, August 25, 2010 11:26 AM
To: r-help at r-project.org
Subject: [R] What does this warning message (from optim function) mean?

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.



More information about the R-help mailing list