<?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: compute a formula in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176389#M1740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="404045" data-username="Hutch%40sas" href="https://communities.sas.com/people/Hutch@sas" id="jive-40404520544852219592186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Hutch@sas&lt;/A&gt; &lt;/STRONG&gt;&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="813022" data-username="stat%40sas" href="https://communities.sas.com/people/stat@sas" id="jive-81302220544852228231186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;stat@sas&lt;/A&gt; &lt;/STRONG&gt; &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1051" data-externalid="" data-presence="null" data-userid="129106" data-username="Rick%40SAS" href="https://communities.sas.com/people/Rick@SAS" id="jive-12910620544852236690186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Rick Wicklin&lt;/A&gt; &lt;/STRONG&gt; .&amp;nbsp; I just suppose SAS can give me a simple code to get X like &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="404045" data-username="Hutch%40sas" href="https://communities.sas.com/people/Hutch@sas" id="jive-40404520544852219592186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Hutch@sas&lt;/A&gt;&lt;/STRONG&gt; did .&lt;/P&gt;&lt;P&gt;Sorry .I can't mark it as answered , because I can't find that button .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Jul 2014 12:11:15 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-07-12T12:11:15Z</dc:date>
    <item>
      <title>compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176385#M1736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want compute such formula. How could I get it ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10= 1.2*(1+ x ) +&amp;nbsp; 1.2*(1+ x )**2 + 1.2*(1+ x )**3 + 1.2*(1+ x )**4 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want x= ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 16:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176385#M1736</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-07-11T16:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176386#M1737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a 4th degree poynomial there will be generally 4 complex solutions. Looks like the polyroot() function&amp;nbsp; is what you need, check the IML documentation. I suggest you first compute z = polyroot( {1.2 1.2 1.2 1.2 -10) to get the imaginary roots, then&amp;nbsp; since z = 1 + x, x = z-1, just subtract 1 from the first column of z to get x, i. e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;a = {1.2 1.2 1.2 1.2 -10};&lt;/P&gt;&lt;P&gt;z = polyroot(a);&lt;/P&gt;&lt;P&gt;x = z - {1 0,1 0,1 0,1 0};&lt;/P&gt;&lt;P&gt;print x;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 16:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176386#M1737</guid>
      <dc:creator>Hutch_sas</dc:creator>
      <dc:date>2014-07-11T16:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176387#M1738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you take 1.2 as a common above equation becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10=1.2{(1+x) + (1+x)**2 + (1+x)**3 + (1+x)**4}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10 = 1.2[{1-(x+1)**5}/{1-(x+1)} as a result of geometric series in (1+x)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and more simplified form is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.2(x+1)**5 - 10x - 1=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 16:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176387#M1738</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-07-11T16:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176388#M1739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want only the real roots on a bounded interval, use the FROOT function. See &lt;A href="http://blogs.sas.com/content/iml/2014/02/05/find-the-root-of-a-function/" title="http://blogs.sas.com/content/iml/2014/02/05/find-the-root-of-a-function/"&gt; A simple way to find the root of a function of one variable - The DO Loop&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 17:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176388#M1739</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-07-11T17:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176389#M1740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="404045" data-username="Hutch%40sas" href="https://communities.sas.com/people/Hutch@sas" id="jive-40404520544852219592186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Hutch@sas&lt;/A&gt; &lt;/STRONG&gt;&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="813022" data-username="stat%40sas" href="https://communities.sas.com/people/stat@sas" id="jive-81302220544852228231186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;stat@sas&lt;/A&gt; &lt;/STRONG&gt; &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1051" data-externalid="" data-presence="null" data-userid="129106" data-username="Rick%40SAS" href="https://communities.sas.com/people/Rick@SAS" id="jive-12910620544852236690186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Rick Wicklin&lt;/A&gt; &lt;/STRONG&gt; .&amp;nbsp; I just suppose SAS can give me a simple code to get X like &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="404045" data-username="Hutch%40sas" href="https://communities.sas.com/people/Hutch@sas" id="jive-40404520544852219592186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Hutch@sas&lt;/A&gt;&lt;/STRONG&gt; did .&lt;/P&gt;&lt;P&gt;Sorry .I can't mark it as answered , because I can't find that button .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2014 12:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176389#M1740</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-07-12T12:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176390#M1741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the program from the blog post. I replaced the function in the post with the example that you give:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;start Func(x);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; fx = 1.2*(1+ x) +&amp;nbsp; 1.2*(1+ x)##2 + 1.2*(1+ x)##3 + 1.2*(1+ x)##4; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; return(fx - 10);&amp;nbsp; /* find x where f(x)=10 */&lt;BR /&gt;finish;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intervals = {-4 -1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 1st interval [-4, -1] */&lt;BR /&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; -1&amp;nbsp; 1};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 2nd interval [-1,&amp;nbsp; 1] */&lt;BR /&gt;z = froot("Func", intervals);&lt;BR /&gt;print z;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 10:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176390#M1741</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-07-13T10:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176391#M1742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Doctor &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1051" data-externalid="" data-presence="null" data-userid="129106" data-username="Rick%40SAS" href="https://communities.sas.com/people/Rick@SAS" id="jive-12910620636168721193186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Rick Wicklin&lt;/A&gt;&lt;/STRONG&gt; ,&lt;/P&gt;&lt;P&gt;I think I should start to learn IML in near future .&lt;/P&gt;&lt;P&gt;I also can get it by brutally enumerate the X value . right ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;/H1&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 13:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176391#M1742</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-07-13T13:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176392#M1743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could hijack &lt;STRONG&gt;proc nlin&lt;/STRONG&gt; to do the job:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;y = 10;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc nlin data=test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;parms x 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model y = 1.2*(1+ x ) +&amp;nbsp; 1.2*(1+ x )**2 + 1.2*(1+ x )**3 + 1.2*(1+ x )**4 ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;PG&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2014 20:57:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176392#M1743</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-13T20:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176393#M1744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, sort of. If you want a DATA step solution, there are ways that are better than enumeration.&amp;nbsp; You can use the bisection method. Do an internet search and you'll find DATA step implementations of the bisection method, such as this one: &lt;A href="http://analytics.ncsu.edu/sesug/2007/PO21.pdf" title="http://analytics.ncsu.edu/sesug/2007/PO21.pdf"&gt;http://analytics.ncsu.edu/sesug/2007/PO21.pdf&lt;/A&gt;&amp;nbsp;&amp;nbsp; The key is that these algorithms find the "zeros" (or roots) so you want to solve for the roots of f(x)-10=0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2014 10:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176393#M1744</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-07-14T10:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: compute a formula</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176394#M1745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks Doctor &lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-objectid="129106" data-objecttype="3" href="https://communities.sas.com/people/Rick@SAS" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;Rick Wicklin&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; , and PG . I learn a lot from you guys.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Xia Keshan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2014 12:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/compute-a-formula/m-p/176394#M1745</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-07-14T12:20:15Z</dc:date>
    </item>
  </channel>
</rss>

