[R] Fitting Data to a Noncentral Chi-Squared Distribution using MLE

2007-09-11 Thread Terence Broderick
Hi, I have written out the log-likelihood function to fit some data I have (called ONES20) to the non-central chi-squared distribution. >library(stats4) >ll<-function(lambda,k){x<-ONES20; 25573*0.5*lambda-25573*log(2)-sum(-x/2)-log((x/lambda)^(0.25*k-0.5))-log(besselI(sqrt(lambda*x),0.5*

[R] Fitting data to chi-squared or noncentral chi-squared distributions

2007-09-11 Thread Terence Broderick
Does anybody have any experience fitting data to the non-central chi-squared or chi-squared distribution? I am trying to fit some data to this distribution but there is error after error. audaces fortuna iuvat - [[alternative HTML version deleted]