<?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 Quantile of Negative Binomial and Hypergeometric distributions in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49477#M28135</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Is there way to get quantile of Negative Binomial and Hypergeometric distributions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 10:39:32 GMT</pubDate>
    <dc:creator>ptolomey</dc:creator>
    <dc:date>2018-01-10T10:39:32Z</dc:date>
    <item>
      <title>Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49477#M28135</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Is there way to get quantile of Negative Binomial and Hypergeometric distributions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 10:39:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49477#M28135</guid>
      <dc:creator>ptolomey</dc:creator>
      <dc:date>2018-01-10T10:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49495#M28141</link>
      <description>&lt;P&gt;Yes!&amp;nbsp; There are functions for both of those distributions.&amp;nbsp; Check out Hypergeometric Distribution() and Neg Binomial Distribution().&amp;nbsp; For the PMF, check out Hypergeometric Probability and Neg Binomial Probability()&lt;/P&gt;&lt;P&gt;Example of Hypergeometric Distribution:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;N_pop=100;
K=20;
n_samp = 10;
x=4;

Hypergeometric Distribution(N_pop,K,n_samp,x);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Example of Neg Binomial Distribution:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;p = 0.5; //prob. of success
n = 10; //number of succeses
x = 5;

Neg Binomial Distribution(p, n, x);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:56:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49495#M28141</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-01-10T15:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49497#M28143</link>
      <description>&lt;P&gt;Just to add to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582"&gt;@cwillden&lt;/a&gt;&amp;nbsp;comment, all such functions are easily found in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;One needs to learn to go to this documentation as the first stop for such questions.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:48:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49497#M28143</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-01-10T15:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49723#M28291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582" target="_blank"&gt;cwillden&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thank you for reply.&lt;/P&gt;&lt;P&gt;I bag your pardon for not emphasizing in previous post, that I am interested in finding&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;Negative Binomial&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;Quantile&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Hypergeometric&amp;nbsp;Quantile&amp;nbsp;&lt;/STRONG&gt;functions in JMP.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please notify if you know how to calculate&amp;nbsp;&lt;STRONG&gt;Quantile&amp;nbsp;&lt;/STRONG&gt;for&amp;nbsp;these descrete distributions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 18:50:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49723#M28291</guid>
      <dc:creator>ptolomey</dc:creator>
      <dc:date>2018-01-16T18:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49724#M28292</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8757"&gt;@ptolomey&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582" target="_blank"&gt;cwillden&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thank you for reply.&lt;/P&gt;&lt;P&gt;I bag your pardon for not emphasizing in previous post, that I am interested in finding&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;Negative Binomial&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;Quantile&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Hypergeometric&amp;nbsp;Quantile&amp;nbsp;&lt;/STRONG&gt;functions in JMP.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please notify if you know how to calculate&amp;nbsp;&lt;STRONG&gt;Quantile&amp;nbsp;&lt;/STRONG&gt;for&amp;nbsp;these descrete distributions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So, you want the inverse of the CDF then, correct?&amp;nbsp; You want a function where you input a quantile and the distributional parameters and the function returns a value of the random variable that corresponds to the specified quantile?&amp;nbsp; The functions I suggested are the CDF and take a value for the random variable and return the quantile.&amp;nbsp; Just want to make sure we're on the same page.&lt;/P&gt;&lt;P&gt;If so, I don't believe there are built-in functions in JMP, and that may be because they would be a step function if the distribution is discrete. You could write your own quantile functions using loops to find the smallest value of your random variable that is greater than the desired quantile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Hypergeometric Quantile = function({quantile, N_pop, K, n_samp},
	x=0;
	condition = 0;
	while(!condition,
		If(
			Hypergeometric Distribution(N_pop, K, N_samp, x) &amp;gt;= quantile,
			condition = 1,
			x++
		);
	);
	x
);

Hypergeometric Quantile(0.5, 100, 20, 10); //returns the value 2&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 20:42:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49724#M28292</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-01-16T20:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49755#M28316</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582" target="_blank"&gt;cwillden&lt;/A&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you for elegant solution.&lt;/P&gt;&lt;P&gt;There is just one comment to it.&lt;/P&gt;&lt;P&gt;The loop provided by you will return &lt;STRONG&gt;integer random variable + 1 &lt;/STRONG&gt;instead&amp;nbsp;&lt;STRONG&gt;integer random variable&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The corrected loop is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;while(1,
	if(
		Hypergeometric Distribution(N_pop, K, N_samp, x) &amp;gt;= quantile,
		Break(),
		x++
	);
      );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:22:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49755#M28316</guid>
      <dc:creator>ptolomey</dc:creator>
      <dc:date>2018-01-17T13:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile of Negative Binomial and Hypergeometric distributions</title>
      <link>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49781#M28323</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8757"&gt;@ptolomey&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I think the loops are actually equivalent.&amp;nbsp; If the condition is met, x++ is never evaluated again&amp;nbsp;and the loop will break when it returns to check the While condition again.&amp;nbsp; I tested both versions and they return the same values.&amp;nbsp; Although, I think using break() in the while loop is probably preferable to what I did.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 16:21:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quantile-of-Negative-Binomial-and-Hypergeometric-distributions/m-p/49781#M28323</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-01-17T16:21:39Z</dc:date>
    </item>
  </channel>
</rss>

