<?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 Func Rannor in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83403#M568</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm simulating a variable say X that follows a normal standard distribution with the rannor() function.&lt;/P&gt;&lt;P&gt;With n=5000, the mean of X is far from 0 and out of the prediction interval.&lt;/P&gt;&lt;P&gt;With 100 000 000 generated variables, the mean is near 0 but we cannot simulate such a number of variables for the rest of our work.&lt;/P&gt;&lt;P&gt;With R, the same simulation produces a variable with a mean less than 1.10-4 in absolute value and this with only 500 generated variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same problem occurs with the normal() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use SAS 9.2 with Windows 7 X64.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you encounter the same problem ? Is it due to SAS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y1=rannor(-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y2=normal(-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=test;&lt;/P&gt;&lt;P&gt;var Y1 Y2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2012 16:22:30 GMT</pubDate>
    <dc:creator>SASorR</dc:creator>
    <dc:date>2012-06-14T16:22:30Z</dc:date>
    <item>
      <title>Func Rannor</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83403#M568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm simulating a variable say X that follows a normal standard distribution with the rannor() function.&lt;/P&gt;&lt;P&gt;With n=5000, the mean of X is far from 0 and out of the prediction interval.&lt;/P&gt;&lt;P&gt;With 100 000 000 generated variables, the mean is near 0 but we cannot simulate such a number of variables for the rest of our work.&lt;/P&gt;&lt;P&gt;With R, the same simulation produces a variable with a mean less than 1.10-4 in absolute value and this with only 500 generated variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same problem occurs with the normal() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use SAS 9.2 with Windows 7 X64.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you encounter the same problem ? Is it due to SAS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y1=rannor(-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y2=normal(-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=test;&lt;/P&gt;&lt;P&gt;var Y1 Y2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83403#M568</guid>
      <dc:creator>SASorR</dc:creator>
      <dc:date>2012-06-14T16:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Func Rannor</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83404#M569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not particularly helpful, but you can see this thread with some discussion around random numbers in SAS though they're discussing the uniform distribution instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://listserv.uga.edu/cgi-bin/wa?A2=ind1204c&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;P=19477" title="http://listserv.uga.edu/cgi-bin/wa?A2=ind1204c&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;P=19477"&gt;http://listserv.uga.edu/cgi-bin/wa?A2=ind1204c&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;P=19477&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try the rand('normal', 0, 1) function. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83404#M569</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-06-14T16:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Func Rannor</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83405#M570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get no sign of non-normality with this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y1=rannor(-1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y2=normal(-1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y3=rand("NORMAL");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc univariate data=test normal;&lt;BR /&gt;var Y1 Y2 Y3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using SAS 9.3 on Windows 7, 32 bits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83405#M570</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-06-14T16:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Func Rannor</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83406#M571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I recall correctly both of these random functions will use the same random number stream.&amp;nbsp; Use the CALL versions to have a different stream for each function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be causing your problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 17:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83406#M571</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-06-14T17:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Func Rannor</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83407#M572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A few comments:&lt;/P&gt;&lt;P&gt;1) RANNOR and NORMAL are the same function. NORMAL is just an alias to RANNOR.&lt;/P&gt;&lt;P&gt;2) A 95% confidence interval means that in 95% of random samples, the sample mean will be within the computed CI.&amp;nbsp; In terns of "seeds," this means that 95% of seeds will give a sample mean within the CI. So any single sample doesn't tell us anything. You might be "unlucky" and choose that one-in-twenty seed!&lt;/P&gt;&lt;P&gt;3) I am running on Windows 7 and X64 and I do not see the situation you report. Use the CLM option on the PROC MEANS statement to get PROC MEANS to display the confidence limits:&lt;/P&gt;&lt;P&gt;proc means data=test N mean clm;&lt;/P&gt;&lt;P&gt;var Y1 Y2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 12:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Func-Rannor/m-p/83407#M572</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-07-23T12:14:31Z</dc:date>
    </item>
  </channel>
</rss>

