Hi Guys: I am trying to code a random effects model in PROC NLMIXED using the truncated poisson likelihood. I assume that the form of the likelihood for my data whichs has a fixed upper value is:
Pr(X=x) /Pr(X< =x)
So the numerator part of this likelihood is just the poisson likelihood but the denominator part is Sum(i=1..K ,Pr(X=k)) which is just the cumulative poisson but only upto a finite k. My code is as follows:
********************************************************************************************
proc nlmixed data=reuse(where=(reuse_n>=0)) DS=5 qpoints=1;
v11 = a11*a11;
v12 = a11*a12;
v22 = a12*a12 + a22*a22;
mu = exp(br0 + br1*time + br2*flux + br3*time*flux + u0 + u1*time);
lr=-mu + reuse_n * log(mu) - log(fact(reuse_n))-poisson(20,mu);
model reuse_n ~ general(lr);
random u0 u1 ~ normal([0, 0],[v11,v12,v22]) subject=id;
run;
********************************************************************************************
I am assuming that if my data is truncated at k=20 then the cumulative part of the likelihood is poisson(20,mu). I tried this and it does not run and gives me the following error messages:
NOTE: The parameters br0, br1, br2, br3 are assigned the default starting value of 1.0, because they are not assigned initial values with the PARMS statement.
NOTE: A finite difference approximation is used for the derivative of the POISSON function at line 77 column 40.
NOTE: Execution error for observation 1.
If anyone could help me with this issue I would be extremely grateful. I have seen a PROC NLMIXED example where the users uses the probnorm statment and that runs fine so I assumed that SAS knows how to take the derivative of the poisson cdf.
Thanks Guys