[R] newton-raphson

From: <dlavecchia_at_tiscali.it>
Date: Thu 01 Dec 2005 - 03:08:47 EST

Hi everybody,
I have to solve a score function by using Newton-Raphson algorithm. Is there such a fucntion in R? I have built this algoritm

newton<-function(tgt,drva,th0,err) {
repeat {iter = iter+1
if (abs(th0-th1)<err||abs(tgt(th1))<.1e-10) break

but it does not work for my function because the ratio "tgt(th0)/drva(th0)" is very high and the algoritm does not converge. On the contrary it works very well for some simple functions (like X^2, X^3..and so on) Please, can you help me?

Thanks in advance,

Solo con Tiscali Adsl navighi senza limiti e telefoni senza canone Telecom a partire da 19,95 Euro/mese.
Attivala subito, I PRIMI DUE MESI SONO GRATIS! CLICCA QUI: http://abbonati.tiscali.it/adsl/sa/1e25flat_tc/

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Dec 01 04:06:27 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:25 EST