<?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: Generation of Gamma random variables (univariate-2 parameters and multivariate) in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103482#M773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the solution to question 1 from &lt;A href="http://pages.stat.wisc.edu/~yandell/software/sas/data.html" title="http://pages.stat.wisc.edu/~yandell/software/sas/data.html"&gt;SAS Data Steps&lt;/A&gt; under the section "Random numbers". The solution is x = b*rangam(seed,a); /* gamma with shape a &amp;amp; scale b */. Does anyone have a clue on question 2 above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2012 12:19:57 GMT</pubDate>
    <dc:creator>KGeorge</dc:creator>
    <dc:date>2012-10-23T12:19:57Z</dc:date>
    <item>
      <title>Generation of Gamma random variables (univariate-2 parameters and multivariate)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103481#M772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could someone kindly help with the following?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I would like to generate gamma distributed random variables using two parameters alpha(shape) and beta(scale). The call function randgen(gamVar,'GAMMA',alpha) sets beta=1 and hence uses one parameter. How can I generate with the two parameters in stead of assuming one of the parameters = 1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. How can I generate correlated/multivariate Gamma random variables? This can probably be done using the Wishart function call, right? How exactly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance,&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 08:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103481#M772</guid>
      <dc:creator>KGeorge</dc:creator>
      <dc:date>2012-10-23T08:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Generation of Gamma random variables (univariate-2 parameters and multivariate)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103482#M773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the solution to question 1 from &lt;A href="http://pages.stat.wisc.edu/~yandell/software/sas/data.html" title="http://pages.stat.wisc.edu/~yandell/software/sas/data.html"&gt;SAS Data Steps&lt;/A&gt; under the section "Random numbers". The solution is x = b*rangam(seed,a); /* gamma with shape a &amp;amp; scale b */. Does anyone have a clue on question 2 above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 12:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103482#M773</guid>
      <dc:creator>KGeorge</dc:creator>
      <dc:date>2012-10-23T12:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generation of Gamma random variables (univariate-2 parameters and multivariate)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103483#M774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) If X is a random variable with unit scale, beta*X is a random variable with scale parameter beta.&lt;/P&gt;&lt;P&gt;Therefore:&lt;/P&gt;&lt;P&gt;call randgen(gamVar,'GAMMA',alpha);&lt;/P&gt;&lt;P&gt;gamVar = beta*gamVar;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) As it says in the doc for the Wishart distribution, there are several distributions that are known as "multivariate gamma."&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/imlug/65547/HTML/default/viewer.htm#imlug_modlib_sect023.htm"&gt;http://support.sas.com/documentation/cdl/en/imlug/65547/HTML/default/viewer.htm#imlug_modlib_sect023.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The Wishart distribution is best known as the distribution for the covariance of a sample drawn from a MV normal.&lt;/P&gt;&lt;P&gt;If you require that the marginal distributions be univariate gamma (I do), then there are several options for multivariate gamma. For bivariate gamma, see p. 586-588 of Devroye's book, &lt;A href="http://luc.devroye.org/rnbookindex.html" title="http://luc.devroye.org/rnbookindex.html"&gt;Non-Uniform Random Variate Generation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For higher dimensions, I'd probably use PROC COPULA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 12:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103483#M774</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-10-23T12:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Generation of Gamma random variables (univariate-2 parameters and multivariate)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103484#M775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rick for your reply. I am interested in the general case, bivariate or higher dimensional (indeed) with marginals being univariate gamma. Could you please illustrate with an example of how to implement this using proc copula?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Nov 2012 04:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generation-of-Gamma-random-variables-univariate-2-parameters-and/m-p/103484#M775</guid>
      <dc:creator>KGeorge</dc:creator>
      <dc:date>2012-11-04T04:50:38Z</dc:date>
    </item>
  </channel>
</rss>

