[R] newton-raphson

2005-11-30 Thread dlavecchia
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) {
iter=0
repeat  {iter = iter+1
th1=th0-tgt(th0)/drva(th0)
if (abs(th0-th1)err||abs(tgt(th1)).1e-10)
break
th0=th1}
th1
}

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,
Davide   



__
TISCALI ADSL
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


[R] question about AIC

2004-11-16 Thread dlavecchia
Hi everybody,
we are a pool of phd students and we have a question about AIC. We are 
interested
in calculating the AIC for a mixture model on galaxies data. So far we have
found AIC works only for regression models, whereas we need AIC for a mixture
of Normal with mean, sd and weights given by our  EM algorithm.
May you help us?
thanks in advance


__
Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.
http://abbonati.tiscali.it/adsl/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html