Thankyou very much. I think "try" works for me.
I am learning it .
Sirius
--
View this message in context:
http://r.789695.n4.nabble.com/optimization-in-for-loop-tp3633638p3634100.html
Sent from the R help mailing list archive at Nabble.com.
__
R-hel
On Jun 29, 2011, at 2:31 PM, siriustar wrote:
Hi, dear R help
I am trying to use optim inside a for loop:
##For example. a: intial guess. b: result. f: function to be
minimized
for (i in 1:10) {
b[i] <- optim(a[i], f)}
However, some intial values cause error in optim function (e.g. "
Hi, dear R help
I am trying to use optim inside a for loop:
##For example. a: intial guess. b: result. f: function to be minimized
for (i in 1:10) {
b[i] <- optim(a[i], f)}
However, some intial values cause error in optim function (e.g. " system is
computationally singular..."). Then the for
3 matches
Mail list logo