[R] re 11. uniroot and function opposite signs warning

tfjbl at mail.uas.alaska.edu tfjbl at mail.uas.alaska.edu
Sun Jul 30 19:17:17 CEST 2006


Nurza,
Try running a while loop steping out until you have a start and finish 
thats the function is opposite in sign. You need a "start" and "finish"
where F is + and - on either side of the loop. Graphing F might help.


step<-10
checkme<-F(start)*F(finish+step)

while(checkme>0){
initialstep<-initialstep*2
checkme<-F(start)*F(finish+step)
}
answer<-uniroot(F,low=start,up=finish+step,maxiter=100)$root



Enjoy
Joe Liddle
tfjbl at uas.alaska.edu
-------------- next part --------------
An embedded message was scrubbed...
From: r-help-request at stat.math.ethz.ch
Subject: R-help Digest, Vol 41, Issue 30
Date: Sun, 30 Jul 2006 12:00:03 +0200
Size: 45962
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060730/f9063a18/attachment.mht 


More information about the R-help mailing list