<?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 Help with CALL QUAD for integration in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Help-with-CALL-QUAD-for-integration/m-p/461669#M4179</link>
    <description>&lt;P&gt;I&amp;nbsp;have some doubt regarding call quad , getting matrix not performed operation.&lt;/P&gt;
&lt;P&gt;PROC IML;&lt;/P&gt;
&lt;P&gt;USE test2;&lt;/P&gt;
&lt;P&gt;READ all var _ALL_ into B;&lt;BR /&gt;CLOSE close test2;&lt;BR /&gt;csho = B[1,1];&lt;BR /&gt;t_debt = B[1,2];&lt;BR /&gt;va = B[1,3];&lt;BR /&gt;siga = B[1,4];&lt;BR /&gt;debt_face = B[1,5];&lt;BR /&gt;exp_rf = B[1,6];&lt;BR /&gt;rf_net = B[1,7];&lt;BR /&gt;exp_divex= B[1,8];&lt;BR /&gt;exp_rfex = B[1,9];&lt;/P&gt;
&lt;P&gt;x = B[1,10];&lt;/P&gt;
&lt;P&gt;lambda = B[1,11];&lt;/P&gt;
&lt;P&gt;ext_opt = B[1,12];&lt;/P&gt;
&lt;P&gt;ylow = B[1,13];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/* Define the integrand to estimate warrant price eq. 50 */&lt;BR /&gt;START FUN(y) GLOBAL (va, rf_net, siga, t_debt, debt_face, csho, x, exp_divex, exp_rf, exp_rfex, lambda, ext_opt, vd, ylow);&lt;BR /&gt;IF ext_opt = 0 THEN ext_opt = .0001;&lt;BR /&gt;f1d = (y - LOG((debt_face + csho * x)) + (rf_net + 0.5 * siga**2) * ext_opt) / (siga * SQRT(ext_opt));&lt;BR /&gt;f2d = f1d - (siga * SQRT(ext_opt)) ;&lt;BR /&gt;opt = (EXP(y) * exp_divex * PROBNORM(f1d) - (debt_face + csho * x) * exp_rfex * PROBNORM(f2d)) ;&lt;BR /&gt;mu = LOG(va) + (rf_net - 0.5 * siga**2) * t_debt;&lt;BR /&gt;sigma = siga * SQRT(t_debt);&lt;BR /&gt;a0 = (LOG(debt_face + csho * x) -mu) / sigma;&lt;BR /&gt;pdf = EXP(-((y - mu)**2/(2 * sigma**2))) / (SQRT (2 * CONSTANT('PI')) * sigma);&lt;BR /&gt;pre = lambda * exp_rf;&lt;BR /&gt;int = pre * opt* pdf;&lt;BR /&gt;return(int);&lt;BR /&gt;finish;&lt;BR /&gt;/* SAS does not like very low lower bounds. no value if 2 std below face?&lt;BR /&gt;*/&lt;BR /&gt;mu = LOG(va) + (rf_net - 0.5 * siga**2) * t_debt;&lt;BR /&gt;sigma = siga * SQRT(t_debt);&lt;BR /&gt;yhigh = mu + 5 * sigma;&lt;BR /&gt;mid = (yhigh + ylow) / 2;&lt;BR /&gt;/* interval = ylow||yhigh;*/&lt;BR /&gt;%put &amp;amp;ylow;&lt;BR /&gt;%put &amp;amp;yhigh;&lt;BR /&gt;call quad(z,"START FUN(y) GLOBAL",[1,13]||mu + 5 * sigma) ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;z value is not performing please guide me how to proceed.&lt;/P&gt;</description>
    <pubDate>Mon, 14 May 2018 12:34:23 GMT</pubDate>
    <dc:creator>Jagadeesh_babu</dc:creator>
    <dc:date>2018-05-14T12:34:23Z</dc:date>
    <item>
      <title>Help with CALL QUAD for integration</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Help-with-CALL-QUAD-for-integration/m-p/461669#M4179</link>
      <description>&lt;P&gt;I&amp;nbsp;have some doubt regarding call quad , getting matrix not performed operation.&lt;/P&gt;
&lt;P&gt;PROC IML;&lt;/P&gt;
&lt;P&gt;USE test2;&lt;/P&gt;
&lt;P&gt;READ all var _ALL_ into B;&lt;BR /&gt;CLOSE close test2;&lt;BR /&gt;csho = B[1,1];&lt;BR /&gt;t_debt = B[1,2];&lt;BR /&gt;va = B[1,3];&lt;BR /&gt;siga = B[1,4];&lt;BR /&gt;debt_face = B[1,5];&lt;BR /&gt;exp_rf = B[1,6];&lt;BR /&gt;rf_net = B[1,7];&lt;BR /&gt;exp_divex= B[1,8];&lt;BR /&gt;exp_rfex = B[1,9];&lt;/P&gt;
&lt;P&gt;x = B[1,10];&lt;/P&gt;
&lt;P&gt;lambda = B[1,11];&lt;/P&gt;
&lt;P&gt;ext_opt = B[1,12];&lt;/P&gt;
&lt;P&gt;ylow = B[1,13];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/* Define the integrand to estimate warrant price eq. 50 */&lt;BR /&gt;START FUN(y) GLOBAL (va, rf_net, siga, t_debt, debt_face, csho, x, exp_divex, exp_rf, exp_rfex, lambda, ext_opt, vd, ylow);&lt;BR /&gt;IF ext_opt = 0 THEN ext_opt = .0001;&lt;BR /&gt;f1d = (y - LOG((debt_face + csho * x)) + (rf_net + 0.5 * siga**2) * ext_opt) / (siga * SQRT(ext_opt));&lt;BR /&gt;f2d = f1d - (siga * SQRT(ext_opt)) ;&lt;BR /&gt;opt = (EXP(y) * exp_divex * PROBNORM(f1d) - (debt_face + csho * x) * exp_rfex * PROBNORM(f2d)) ;&lt;BR /&gt;mu = LOG(va) + (rf_net - 0.5 * siga**2) * t_debt;&lt;BR /&gt;sigma = siga * SQRT(t_debt);&lt;BR /&gt;a0 = (LOG(debt_face + csho * x) -mu) / sigma;&lt;BR /&gt;pdf = EXP(-((y - mu)**2/(2 * sigma**2))) / (SQRT (2 * CONSTANT('PI')) * sigma);&lt;BR /&gt;pre = lambda * exp_rf;&lt;BR /&gt;int = pre * opt* pdf;&lt;BR /&gt;return(int);&lt;BR /&gt;finish;&lt;BR /&gt;/* SAS does not like very low lower bounds. no value if 2 std below face?&lt;BR /&gt;*/&lt;BR /&gt;mu = LOG(va) + (rf_net - 0.5 * siga**2) * t_debt;&lt;BR /&gt;sigma = siga * SQRT(t_debt);&lt;BR /&gt;yhigh = mu + 5 * sigma;&lt;BR /&gt;mid = (yhigh + ylow) / 2;&lt;BR /&gt;/* interval = ylow||yhigh;*/&lt;BR /&gt;%put &amp;amp;ylow;&lt;BR /&gt;%put &amp;amp;yhigh;&lt;BR /&gt;call quad(z,"START FUN(y) GLOBAL",[1,13]||mu + 5 * sigma) ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;z value is not performing please guide me how to proceed.&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 12:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Help-with-CALL-QUAD-for-integration/m-p/461669#M4179</guid>
      <dc:creator>Jagadeesh_babu</dc:creator>
      <dc:date>2018-05-14T12:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CALL QUAD for integration</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Help-with-CALL-QUAD-for-integration/m-p/462021#M4180</link>
      <description>&lt;P&gt;You are not calling the QUAD routine correctly. &lt;A href="http://go.documentation.sas.com/?docsetId=imlug&amp;amp;docsetTarget=imlug_langref_sect326.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;See the documentation&lt;/A&gt; for examples. The second argument is the name of the function ("FUN") and the third is a two-element vector that gives the endpoints of the domain of integration:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call quad(z,"FUN", yLow || yHigh); /* integral on interval [yLow, yHigh] */&lt;BR /&gt;print z;&lt;/P&gt;
&lt;P&gt;call quad(z,"FUN", {1 13}); /* integral on interval [1, 13] */&lt;BR /&gt;print z;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 12:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Help-with-CALL-QUAD-for-integration/m-p/462021#M4180</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-05-14T12:42:36Z</dc:date>
    </item>
  </channel>
</rss>

