<?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: SAS integration that could not be solved in closed form in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153478#M8052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the CDF of a well-known distribution?&amp;nbsp; If so, you can use the CDF function in SAS as part of the integrand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To compute a numerical&amp;nbsp; integration with known limits of integration, use the QUAD call in PROC IML. For the standard normal CDF and [a,b] = [0,1], the call would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start Func(x);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return(&amp;nbsp; exp(2-x)#cdf("Normal", x) );&lt;BR /&gt;finish;&lt;/P&gt;&lt;P&gt;interval = {0 1};&lt;/P&gt;&lt;P&gt;call quad(answer, "Func", interval);&lt;BR /&gt;print answer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more on numerical integration with SAS, I have written several blog posts. You might want to do an internet search for&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; integrate function site:&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://blogs.sas.com/content/iml/"&gt;http://blogs.sas.com/content/iml/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and include other keywords as necessary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 18:00:38 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2014-09-22T18:00:38Z</dc:date>
    <item>
      <title>SAS integration that could not be solved in closed form</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153477#M8051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can integrate this function in SAS. Limit of integration is&amp;nbsp; a and b. &lt;/P&gt;&lt;P&gt; exp(2-x) CDF(X) dx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Sep 2014 22:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153477#M8051</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2014-09-21T22:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS integration that could not be solved in closed form</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153478#M8052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the CDF of a well-known distribution?&amp;nbsp; If so, you can use the CDF function in SAS as part of the integrand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To compute a numerical&amp;nbsp; integration with known limits of integration, use the QUAD call in PROC IML. For the standard normal CDF and [a,b] = [0,1], the call would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start Func(x);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return(&amp;nbsp; exp(2-x)#cdf("Normal", x) );&lt;BR /&gt;finish;&lt;/P&gt;&lt;P&gt;interval = {0 1};&lt;/P&gt;&lt;P&gt;call quad(answer, "Func", interval);&lt;BR /&gt;print answer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more on numerical integration with SAS, I have written several blog posts. You might want to do an internet search for&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; integrate function site:&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://blogs.sas.com/content/iml/"&gt;http://blogs.sas.com/content/iml/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and include other keywords as necessary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 18:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153478#M8052</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-09-22T18:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS integration that could not be solved in closed form</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153479#M8053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rick,&lt;/P&gt;&lt;P&gt;Thank for your help. I am trying to do this numerical integration within a simulation. I used your code and read through the site but I am having one issue in the code below;&lt;/P&gt;&lt;P&gt;Data sim;&lt;/P&gt;&lt;P&gt;Input A B;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 3&lt;/P&gt;&lt;P&gt;2 7&lt;/P&gt;&lt;P&gt;3 10&lt;/P&gt;&lt;P&gt;4 12&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;use sim;&lt;/P&gt;&lt;P&gt;read all&amp;nbsp; var{A B} into DM;&lt;/P&gt;&lt;P&gt;close;&lt;/P&gt;&lt;P&gt; A = DM[,1]; B = DM[,2];&lt;/P&gt;&lt;P&gt; n = nrow(DM);&lt;/P&gt;&lt;P&gt;start Func(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; return(&amp;nbsp; exp(2-x)#cdf("Normal", x) );&lt;/P&gt;&lt;P&gt;finish;&lt;/P&gt;&lt;P&gt;interval = {A, B};&lt;/P&gt;&lt;P&gt;call quad(answer, "Func", interval);&lt;/P&gt;&lt;P&gt;create kaplan1n var{A&amp;nbsp; B Answer };&lt;/P&gt;&lt;P&gt;append;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 03:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153479#M8053</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2014-09-24T03:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS integration that could not be solved in closed form</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153480#M8054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently this thread is continuing here: &lt;A _jive_internal="true" href="https://communities.sas.com/message/229999#229999"&gt;https://communities.sas.com/message/229999#229999&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 14:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-integration-that-could-not-be-solved-in-closed-form/m-p/153480#M8054</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-09-24T14:32:30Z</dc:date>
    </item>
  </channel>
</rss>

