<?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: Random Number Generating in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412682#M3820</link>
    <description>&lt;P&gt;You asked, "how do I account for the [-infinity, infinity] part?" Here is a hint: What is the range of the expression&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;uniform*pi - pi/2 ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Ask yourself how the TAN function behaves on this interval.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more about the inverse CDF method of simulating data, see &lt;A href="https://blogs.sas.com/content/iml/2013/07/22/the-inverse-cdf-method.html" target="_self"&gt;"The inverse CDF method for simulating from a distribution."&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Nov 2017 12:02:44 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-11-12T12:02:44Z</dc:date>
    <item>
      <title>Random Number Generating</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412614#M3817</link>
      <description>&lt;P&gt;I'm given these two equations:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PDF: f(x) =1/(π(1+x^2))&amp;nbsp; &amp;nbsp; -∞ ≤ x ≤ ∞&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CDF: F(x) =(1/2) + arctan(x)/π&amp;nbsp; -∞ ≤ x ≤ ∞&lt;DIV&gt;and I am asked to generate 10,000 random numbers using the Inversion Method for Cauchy Distribution.&lt;/DIV&gt;&lt;DIV&gt;Here is the code I have started:&lt;/DIV&gt;&lt;DIV&gt;PROC IML;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; n=10000;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;myran = j(n,1, 0);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; uniform = uniform(myran);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; exponential = (tan(uniform*pi-(pi/2)));&lt;/DIV&gt;&lt;DIV&gt;CREATE uniform2 FROM uniform[colname={'x'}];&lt;BR /&gt;APPEND FROM uniform;&lt;BR /&gt;CREATE exp2 FROM exponential[colname={'y'}];&lt;BR /&gt;APPEND FROM exponential;&lt;BR /&gt;QUIT;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but my log says: "ERROR: (execution) Matrix has not been set to a value." after the exponential statement.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;how do I correct for this? I'm not sure how to account for the&amp;nbsp;&lt;SPAN&gt;-∞ ≤ x ≤ ∞ part.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;subsequently, I am asked to create a subset of the 10000 Cauchy Dist. of random numbers where -10&amp;lt;x&amp;lt;10&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 11 Nov 2017 23:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412614#M3817</guid>
      <dc:creator>trash</dc:creator>
      <dc:date>2017-11-11T23:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Random Number Generating</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412631#M3818</link>
      <description>&lt;P&gt;Set the scalar pi to a value after you invoke IML.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pi = constant('pi');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Nov 2017 01:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412631#M3818</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-11-12T01:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Random Number Generating</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412680#M3819</link>
      <description>&lt;P&gt;IML has build-in function, you can use it .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
x=j(10000,1,.);
call randseed(12345678);
call randgen(x, 'CAUCHY'); 

create want var{x};
append;
close;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Nov 2017 11:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412680#M3819</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-12T11:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Random Number Generating</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412682#M3820</link>
      <description>&lt;P&gt;You asked, "how do I account for the [-infinity, infinity] part?" Here is a hint: What is the range of the expression&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;uniform*pi - pi/2 ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Ask yourself how the TAN function behaves on this interval.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more about the inverse CDF method of simulating data, see &lt;A href="https://blogs.sas.com/content/iml/2013/07/22/the-inverse-cdf-method.html" target="_self"&gt;"The inverse CDF method for simulating from a distribution."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2017 12:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-Number-Generating/m-p/412682#M3820</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-11-12T12:02:44Z</dc:date>
    </item>
  </channel>
</rss>

