06-28-2013 04:38 PM
Is there are formula for computing an infinite sum in SAS?
I can compute an approximation for convergent sum by using a DO-WHILE-LOOP but I am trying to do MLE for a PDF using PROC NLMIXED; the parameters are dependent on an infinite sum and will not converge if I use a loop for the infinite sum. Is there a better way to do it?
07-01-2013 08:40 AM
This definitely sounds interesting, but more info would be helpful. The first thing that occurs to me is perhaps reparameterizing so that the optimization within NLMIXED handles the convergence. Can you share the existing code?
The other is to move to PROC IML, where you could code the series and apply some of the optimization functions available to the likelihood function. See some of the posts by Rick Wicklin on this topic.
07-01-2013 10:07 AM
here is an example of what the data would look like:
input n count_n;
I want to use some type of parameter estimation to fit this data to a modified Poisson distribution called the Conway-Maxwell-Poisson distribution ( Conway–Maxwell–Poisson distribution - Wikipedia, the free encyclopedia )
so the proc step would look like...
PROC NLMIXED data = abc;
parms m = 0.5 v=0.5;
/* here is where I need to include a infinite sum Z(m,v) = ??? */
ll = count_n*(n*log(m)-v*log(fact(n))-log(Z));
model count_n ~ general(ll);
07-01-2013 10:45 AM
1. What does your DOW loop look like?
2a. Do you have PROC IML licensed?
2b. Have you ever used R packages?
The first question may make it possible to do in NLMIXED. It looks like the programming statements within NLMIXED support looping, so you might be able to get a close approximation that way (although it seems not from your post).
Question 2 addresses a work-around. There is an R package (compoisson) that will do what you are asking. If you want to run from SAS, though, you will need IML/IML plus to access R. There may also be a "pure" IML approach. Check the postings and blog of .