<?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: Roots of a function with constants as inputs in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Roots-of-a-function-with-constants-as-inputs/m-p/474035#M4247</link>
    <description>&lt;P&gt;I think you are trying to do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
start Func(x) global(a,b);
     return(a*x##2-b);
finish;

a = 1;
b = 2;
bounds = {-2 0,
           0 2};
roots = froot( "Func", bounds);
print roots;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The FROOT function is a numerical root-finder, which means that all symbols must have assigned values. Note also that the FROOT function will return one root for each interval that you specify. If you think you have multiple roots but do not have a good estimate for the intervals on which they occur, read the article &lt;A href="https://blogs.sas.com/content/iml/2015/06/22/root-guess.html" target="_self"&gt;"Finding roots: Automating the search for an initial guess."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking for a SYMBOLIC answer (like the quadratic formula) that gives x in terms of symbolic parameters a and b, then you need to use symbolic&amp;nbsp;software such as Wolfram Alpha. However, only a very small number of functions are invertible.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 12:07:15 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-06-28T12:07:15Z</dc:date>
    <item>
      <title>Roots of a function with constants as inputs</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Roots-of-a-function-with-constants-as-inputs/m-p/474020#M4246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find the root of my function and after some googling i found the FROOT function. As far as I can see/find there is no way to use this on a function that has more than one input. Surely it is possible to something along the lines of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;start Func(x,a,b);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return(a*x##2-b);&lt;BR /&gt;finish;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bounds = {0,2};&lt;BR /&gt;roots = froot( "Func", bounds);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To clarify I want to send in constants in the function and find the root changing only "x".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 10:44:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Roots-of-a-function-with-constants-as-inputs/m-p/474020#M4246</guid>
      <dc:creator>jan_t_lagen</dc:creator>
      <dc:date>2018-06-28T10:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Roots of a function with constants as inputs</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Roots-of-a-function-with-constants-as-inputs/m-p/474035#M4247</link>
      <description>&lt;P&gt;I think you are trying to do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
start Func(x) global(a,b);
     return(a*x##2-b);
finish;

a = 1;
b = 2;
bounds = {-2 0,
           0 2};
roots = froot( "Func", bounds);
print roots;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The FROOT function is a numerical root-finder, which means that all symbols must have assigned values. Note also that the FROOT function will return one root for each interval that you specify. If you think you have multiple roots but do not have a good estimate for the intervals on which they occur, read the article &lt;A href="https://blogs.sas.com/content/iml/2015/06/22/root-guess.html" target="_self"&gt;"Finding roots: Automating the search for an initial guess."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking for a SYMBOLIC answer (like the quadratic formula) that gives x in terms of symbolic parameters a and b, then you need to use symbolic&amp;nbsp;software such as Wolfram Alpha. However, only a very small number of functions are invertible.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 12:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Roots-of-a-function-with-constants-as-inputs/m-p/474035#M4247</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-06-28T12:07:15Z</dc:date>
    </item>
  </channel>
</rss>

