Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- Function to Return Poisson Parameter

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-20-2011 02:21 PM
(1309 views)

Hello!

The functions POISSON(λ,x) and CDF('POISSON',x,λ) return the value of P(X > x | X ~ Poisson(λ)) given the value of the parameter, λ, and the observed count, x, are input.

I would like to do somewhat the opposite: given a probability, p, and an observed count, x, is there a function that will return the value of λ?

Thanks.

The functions POISSON(λ,x) and CDF('POISSON',x,λ) return the value of P(X > x | X ~ Poisson(λ)) given the value of the parameter, λ, and the observed count, x, are input.

I would like to do somewhat the opposite: given a probability, p, and an observed count, x, is there a function that will return the value of λ?

Thanks.

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

have you looked at CALL RANPOI()

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks for the tip Peter C. However, when I looked at the call, it returns random numbers from a Poisson distribution. I am looking for something to return the parameter of a Poisson distribution that matches certain criteria.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I think you may be looking for the QUANTILE function.

[pre]

data a;

m=1;

n=2;

x = poisson(m,n);

y=quantile('POISSON',x,m);

put x= y=;

run;

[/pre]

There used to be a series of probability and inverse prob functions. Although some are still documented most have been supplanted by the more powerful PDF, CDF, and QUANTILE functions.

[pre]

data a;

m=1;

n=2;

x = poisson(m,n);

y=quantile('POISSON',x,m);

put x= y=;

run;

[/pre]

There used to be a series of probability and inverse prob functions. Although some are still documented most have been supplanted by the more powerful PDF, CDF, and QUANTILE functions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

This still returns the x value in the OP. I believe he is looking to return lambda (or m in this example).

The problem is that m is the solution for a cumulative sum of the following type:

probability = sum (i from 0 to n) {exp (-m) * (m**i) / i!}

I can only guess that some sort of grid search/optimization scenario would be able to do this on a general basis.

SteveDenham

The problem is that m is the solution for a cumulative sum of the following type:

probability = sum (i from 0 to n) {exp (-m) * (m**i) / i!}

I can only guess that some sort of grid search/optimization scenario would be able to do this on a general basis.

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Yes, Steve, this is what I was hoping for. I thought maybe SAS had a numerical algorithm already in place to find this. I guess I can write a macro though.

Thanks!

Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

This is a root-finding problem. Define

f(lambda) = target - cdf("poisson", n, lambda);

and solve for the zeros of f. This is always possible (and has a unique solution) because the CDF is an increasing function of lambda. (Of course, 0<target<1).

To solve the problem, find a root-finding algorithm such as the bisection method implemented in SAS. (I believe that the %inv macro at

http://ftp.sas.com/samples/A57496 gives you what you need; Although it is written as a macro, you ought to be able to decipher it.)

If you have SAS/IML, see

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.