Dear all, I have to minimize a (real) function in a loop (say i in (1:1000)) and store its ``$estimate'', via
l2estim<-nlm(f.minimo,c(-.01,0.1))$estimate

into a vector for further analisys.
Since the function's behaviour is quite peculiar (in the sense that in the simulation study it may not have a minumum), sometimes I get the the warning

Error in nlm(minimo, c(-0.01, 0.1), check.analyticals = FALSE) : non-finite value supplied by nlm
In addition: There were 50 or more warnings (use warnings() to see the first 50)

and the cicle stops. How can I avoid this and tell R that if so then l2estim<-0, for example.

Thanks to all, isaia.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Ennio D. Isaia
~ Dep. of Statistics & Mathematics, University of Torino
~ Piazza Arbarello, 8 - 10128 Torino (Italy)
~ Phone: +39 011 670 62 51 ~~ Fax: +39 011 670 62 39
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to