<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Function to Return Poisson Parameter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17644#M2570</link>
    <description>have you looked at CALL RANPOI()</description>
    <pubDate>Tue, 21 Jun 2011 09:06:06 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2011-06-21T09:06:06Z</dc:date>
    <item>
      <title>Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17643#M2569</link>
      <description>Hello!&lt;BR /&gt;
&lt;BR /&gt;
The functions POISSON(λ,x) and CDF('POISSON',x,λ) return the value of P(X &amp;gt; x | X ~ Poisson(λ)) given the value of the parameter, λ, and the observed count, x, are input.&lt;BR /&gt;
&lt;BR /&gt;
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 λ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Mon, 20 Jun 2011 18:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17643#M2569</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2011-06-20T18:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17644#M2570</link>
      <description>have you looked at CALL RANPOI()</description>
      <pubDate>Tue, 21 Jun 2011 09:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17644#M2570</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-06-21T09:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17645#M2571</link>
      <description>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.</description>
      <pubDate>Tue, 21 Jun 2011 20:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17645#M2571</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2011-06-21T20:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17646#M2572</link>
      <description>I think you may be looking for the QUANTILE function.&lt;BR /&gt;
[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
m=1;&lt;BR /&gt;
n=2;&lt;BR /&gt;
x = poisson(m,n);&lt;BR /&gt;
y=quantile('POISSON',x,m);&lt;BR /&gt;
put x= y=;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
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.</description>
      <pubDate>Wed, 22 Jun 2011 05:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17646#M2572</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2011-06-22T05:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17647#M2573</link>
      <description>This still returns the x value in the OP.  I believe he is looking to return lambda (or m in this example).&lt;BR /&gt;
&lt;BR /&gt;
The problem is that m is the solution for a cumulative sum of the following type:&lt;BR /&gt;
&lt;BR /&gt;
probability = sum (i from 0 to n) {exp (-m) * (m**i) / i!}&lt;BR /&gt;
&lt;BR /&gt;
I can only guess that some sort of grid search/optimization scenario would be able to do this on a general basis.&lt;BR /&gt;
&lt;BR /&gt;
SteveDenham</description>
      <pubDate>Wed, 22 Jun 2011 11:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17647#M2573</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2011-06-22T11:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17648#M2574</link>
      <description>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.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Wed, 22 Jun 2011 14:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17648#M2574</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2011-06-22T14:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Function to Return Poisson Parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17649#M2575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a root-finding problem. Define&lt;/P&gt;&lt;P&gt;f(lambda) = target - cdf("poisson", n, lambda);&lt;/P&gt;&lt;P&gt;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&amp;lt;target&amp;lt;1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To solve the problem, find a root-finding algorithm such as the bisection method implemented in SAS. (I believe that the %inv macro at&lt;/P&gt;&lt;P&gt;&lt;A href="http://ftp.sas.com/samples/A57496"&gt;http://ftp.sas.com/samples/A57496&lt;/A&gt; gives you what you need; Although it is written as a macro, you ought to be able to decipher it.) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have SAS/IML, see&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/imlug/63541/HTML/default/viewer.htm#imlug_genstatexpls_sect004.htm"&gt;http://support.sas.com/documentation/cdl/en/imlug/63541/HTML/default/viewer.htm#imlug_genstatexpls_sect004.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 18:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-Return-Poisson-Parameter/m-p/17649#M2575</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-06-28T18:45:20Z</dc:date>
    </item>
  </channel>
</rss>

