[R] r-help@stat.math.ethz.ch

From: Xin <jasonshi510_at_hotmail.com>
Date: Tue 16 May 2006 - 17:23:53 EST


Dear All:

    I tried to fit negative binomial distribution to data in terms of mean and mean is also a quadratic function of another variable. The likelihood function is:

function (parameters, y1,x11)

{  

p<-parameters[1]

alpha1<-parameters[1]

beta1<-parameters[2]

delta1<-parameters[3]  

mu<-alpha1+beta1*(x11)+delta1*(x11^2)  

ifelse(y1>=0|x11>=0,  

L<-

      lgamma(y1+p)+p*(log(p)-log(mu+p))+y1*(log(mu)-log(mu+p))

      -lfactorial(y1)-lgamma(p)  

,Inf)  

L  

}

I got outputs even it sounds a problem for delata. Actually, there is a mistake made for the parameters (p & alpha1) set up. If I correct them as:

p<-parameters[1]

alpha1<-parameters[2]

beta1<-parameters[3]

delta1<-parameters[4]

Then error messga there: initial value in 'vmmin' is not finite In addition: There were 38 warnings (use warnings() to see them).

Could you give some advice please?

Thanks a lot!

Xin Shi

        [[alternative HTML version deleted]]



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 Tue May 16 17:30:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 17 May 2006 - 00:10:09 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.