<?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: Two different ways to generate random numbers -the same or different ?! in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876956#M43370</link>
    <description>&lt;P&gt;Conover's Technometrics article from 1979 or so introduced the idea of Latin Hypercube Sampling.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 19:33:03 GMT</pubDate>
    <dc:creator>StatsMan</dc:creator>
    <dc:date>2023-05-22T19:33:03Z</dc:date>
    <item>
      <title>Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876862#M43357</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; I am doing some computer experiments with Gumbel random numbers.&lt;BR /&gt;1) According to the books and manuals:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALL STREAMINIT(2);&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X= RAND("GUMBEL", MY, SCALE);&lt;BR /&gt;An alternative:&amp;nbsp;&amp;nbsp;&amp;nbsp;Xi= MY - SCALE*LOG( -LOG(RAND('UNIFORM')));&lt;/P&gt;
&lt;P&gt;These two seem to produce results that are identical.&lt;BR /&gt;I have used both to produce a lot of random numbers. Works fine.&amp;nbsp;Then I calculated the Mean, StdDev and a lot of quantiles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) An alternative, when producing many random numbers is the following:&amp;nbsp;&amp;nbsp; &amp;nbsp;X= MY - SCALE*LOG(-LOG(Step));&lt;BR /&gt;where Step is the index in a do-loop. 5Mi values.&amp;nbsp;Then I calculated the Mean, StdDev and a lot of quantiles.&lt;BR /&gt;The values are&amp;nbsp;almost the same as above, with very small differences,&lt;BR /&gt;&lt;BR /&gt;Fine - OR?&lt;/P&gt;
&lt;P&gt;When I look at the values generated using 2) in some small intervals e.g. around the median&amp;nbsp;the values look very smooth and nice.&lt;BR /&gt;When I do the same using the values produced by 1) the&amp;nbsp;values are not at all that smooth, but vary up and down.&lt;BR /&gt;&lt;BR /&gt;Question: Is this described in any paper? Are the values produced in 2) also random numbers.&lt;/P&gt;
&lt;P&gt;I would appreciate some comments and advice on this matter.&lt;/P&gt;
&lt;P&gt;Best Regards AndersS&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 07:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876862#M43357</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-05-22T07:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876866#M43358</link>
      <description>Have a look at these papers, webpages: &lt;A href="https://support.sas.com/resources/papers/proceedings19/3096-2019.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings19/3096-2019.pdf&lt;/A&gt;;&lt;BR /&gt; &lt;A href="https://support.sas.com/resources/papers/proceedings18/1810-2018.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings18/1810-2018.pdf&lt;/A&gt;; &lt;A href="https://blogs.sas.com/content/iml/2020/08/26/rewind-random-number-stream.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2020/08/26/rewind-random-number-stream.html&lt;/A&gt;</description>
      <pubDate>Mon, 22 May 2023 08:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876866#M43358</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-05-22T08:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876870#M43360</link>
      <description>&lt;P&gt;Your first two methods, using the RAND function with the GUMBEL distribution and using RAND with the UNIFORM distribution and using an inverse transform on the cumulative density function for the Gumbel, should return results that are very close - if not identical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The third method, generating observations from the Gumbel using a pre-defined set of probabilities (the values from your DO loop index) will not be considered by most to be a random sample from the Gumbel. That method will give you a very nicely shaped Gumbel curve, but there is no randomness in the selection of your probabilities.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a method that was quite popular in years past called Latin Hypercube sampling that might be of interest to you. Suppose you want to generate 100 random values from a distribution. Instead of using the pre-defined probabilities from the the index of a do-loop, generate a probability from each of the 100 equal-width probability intervals that cover the range 0-1. So, generate a probability on the intervals 0-.01, .01-02, ... , .99-1.0. Use those probabilities with the inverse transform on the cumulative density.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 09:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876870#M43360</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2023-05-22T09:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876881#M43361</link>
      <description>&lt;P&gt;Your first approach generates random values by using the inverse CDF method:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2013/07/22/the-inverse-cdf-method.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2013/07/22/the-inverse-cdf-method.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your second method does not generate any random values. You are simply generating the quantiles of the distribution (assuming 0 &amp;lt; step &amp;lt; 1).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By definition, the quantiles are exact for the second method at the locations that you specify. The quantile ESTIMATES for the first method will be close to the exact values because you are using a large sample size (5M obs), by the Law of Large Numbers.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 10:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876881#M43361</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-05-22T10:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876932#M43366</link>
      <description>Hi! Many thanks!   Yes I will.  /Br AndersS</description>
      <pubDate>Mon, 22 May 2023 17:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876932#M43366</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-05-22T17:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876933#M43367</link>
      <description>Hi! This sounds VERY interesting. Do you have a ny good paper to refer to?&lt;BR /&gt;MANY THANKS!   /Br AndersS</description>
      <pubDate>Mon, 22 May 2023 17:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876933#M43367</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-05-22T17:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876934#M43368</link>
      <description>Hi Rick! I will read it. /Br AndersS&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2023 17:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876934#M43368</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-05-22T17:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876956#M43370</link>
      <description>&lt;P&gt;Conover's Technometrics article from 1979 or so introduced the idea of Latin Hypercube Sampling.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 19:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/876956#M43370</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2023-05-22T19:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Two different ways to generate random numbers -the same or different ?!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/877005#M43372</link>
      <description>Hi! Many thanks. I will look at it. /Br AndersS</description>
      <pubDate>Tue, 23 May 2023 07:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-different-ways-to-generate-random-numbers-the-same-or/m-p/877005#M43372</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-05-23T07:43:06Z</dc:date>
    </item>
  </channel>
</rss>

