<?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: Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/337009#M272492</link>
    <description>&lt;P&gt;In addition to the excellent responses from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;, &lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_kde_details08.htm" target="_self"&gt;use PROC KDE to draw the bivariate histogram&lt;/A&gt;. The BIVAR statement and PLOTS=HISTOGRAM are what you want to use.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2017 14:58:18 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-03-01T14:58:18Z</dc:date>
    <item>
      <title>Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336792#M272487</link>
      <description>&lt;DIV class="expando"&gt;&lt;DIV class="usertext-body may-blank-within md-container "&gt;&lt;DIV class="md"&gt;&lt;P&gt;&lt;SPAN&gt;(a) [10] Write a program to draw 100,000 observations from the following bivariate distribution which is uniform over a unit circle. f(x, y) = 1/ℼ where x&lt;/SPAN&gt;2&lt;SPAN&gt; + y&lt;/SPAN&gt;2&lt;SPAN&gt; &amp;lt; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(b) [10] Draw the bivariate histogram for x and y. (c) [10] Draw the (marginal) histogram for x .&lt;/P&gt;&lt;P&gt;I've tried transforming x and y so that they vary between (-1,1) and then using the Do while loop so that x2 + y2&amp;lt; 1. Still new to SAS so any would be great.&lt;/P&gt;&lt;P&gt;This is my code so far:&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;data test;
    Do i=1 to 10000;
        Do While x^2 + b^2 &amp;lt;1;
            x=2*ranuni(111)-1;
            y=2*ranuni(111)-1;
            z= x^2 + b^2 &amp;lt;1;
        end;
        output;
    end;
run;
ods graphics on;
proc bivariatete data=test;
      var x;
      var y;
      var z;
      histogram z;
  run;
ods graphics off;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Feb 2017 23:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336792#M272487</guid>
      <dc:creator>joesocci</dc:creator>
      <dc:date>2017-02-28T23:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336793#M272488</link>
      <description>&lt;P&gt;This is invalid:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x^2&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In SAS, the correct operator is **&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x**2&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#p00iah2thp63bmn1lt20esag14lh.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#p00iah2thp63bmn1lt20esag14lh.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the histogram, use PROC UNIVARIATE or PROC SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. You have a lot of other errors in your code. I would suggest doing one step at a time, getting that working and then moving forward. Look at Rick Wicklin blog or book for informaiton on how to simulate data in SAS. If you're a student, since this is clearly homework, your university library may have a digital version available for you to peruse.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 23:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336793#M272488</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-28T23:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336811#M272489</link>
      <description>Thank you, I've gotten both x and y to vary between (-1,1), I'm still struggling to restrict it so that x^2 + y^2 &amp;lt;1 and output that data. Any suggestions or help would be appreciated!</description>
      <pubDate>Wed, 01 Mar 2017 01:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336811#M272489</guid>
      <dc:creator>joesocci</dc:creator>
      <dc:date>2017-03-01T01:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336921#M272490</link>
      <description>&lt;P&gt;It is about data simulation, better post it at IML forum.&lt;/P&gt;
&lt;P&gt;what doest f(x,y) looks like,what is its form ?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 10:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336921#M272490</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-01T10:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336929#M272491</link>
      <description>&lt;P&gt;You mean this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2016/03/30/generate-uniform-2d-ball.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2016/03/30/generate-uniform-2d-ball.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 11:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/336929#M272491</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-01T11:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Program for bivariate distribution for f(x, y) = 1/pi where x^2 + y^2 = 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/337009#M272492</link>
      <description>&lt;P&gt;In addition to the excellent responses from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;, &lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_kde_details08.htm" target="_self"&gt;use PROC KDE to draw the bivariate histogram&lt;/A&gt;. The BIVAR statement and PLOTS=HISTOGRAM are what you want to use.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 14:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-for-bivariate-distribution-for-f-x-y-1-pi-where-x-2-y-2/m-p/337009#M272492</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-01T14:58:18Z</dc:date>
    </item>
  </channel>
</rss>

