Message-ID: <E88E0E09-3923-4E11-A0D0-079A2550B38C@auckland.ac.nz>
Date: 2008-09-19T05:08:10Z
From: Rolf Turner
Subject: Error: function cannot be evaluated at initial parameters
In-Reply-To: <19565286.post@talk.nabble.com>
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}}