[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 }

[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