On 19/09/2008, at 2:33 PM, sandsky wrote:


I have an error for a simple optimization problem.

        It is not a simple optimization problem.  It is a
        totally silly optimization problem.

Is there anyone knowing
about this error?

lambda1=-9
lambda2=-6
L<-function(a){
s2i2f<-(exp(-lambda1*(250^a)-lambda2*(275^a-250^a))
       -exp(-lambda1*(250^a)-lambda2*(300^a-250^a)))
logl<-log(s2i2f)
return(-logl)}
optim(1,L)

Error in optim(1, L) : function cannot be evaluated at initial parameters

What is your difficulty? The error means what it says. Nothing more, nothing less.

Did you ***try*** just typing ``L(1)'' to see what you get?

Hint: exp(2250) is infinity as far as your --- or anyone else's --- computer
is concerned.

        cheers,

                Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
R-help@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.

Reply via email to