BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1
Kui
Calcite | Level 5 Kui
Calcite | Level 5
proc sort by id; before running the model.

Kui

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1319 views
  • 0 likes
  • 2 in conversation