<?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 Matrix exponential in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869519#M5978</link>
    <description>Hello,&lt;BR /&gt;I use Proc IML function in SAS Studio for matrix exponential and the procedure is successful. But when I import the matrix in Excel and call matrix exponential function the results are different from the results from SAS. Is there anybody familiar in the method behind the procedure for matrix exponential both Excel and SAS?</description>
    <pubDate>Thu, 13 Apr 2023 07:38:41 GMT</pubDate>
    <dc:creator>Davidova</dc:creator>
    <dc:date>2023-04-13T07:38:41Z</dc:date>
    <item>
      <title>Matrix exponential</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869519#M5978</link>
      <description>Hello,&lt;BR /&gt;I use Proc IML function in SAS Studio for matrix exponential and the procedure is successful. But when I import the matrix in Excel and call matrix exponential function the results are different from the results from SAS. Is there anybody familiar in the method behind the procedure for matrix exponential both Excel and SAS?</description>
      <pubDate>Thu, 13 Apr 2023 07:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869519#M5978</guid>
      <dc:creator>Davidova</dc:creator>
      <dc:date>2023-04-13T07:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869520#M5979</link>
      <description>&lt;P&gt;Please would you show us the syntax you are using both in IML and in EXCEL?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 07:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869520#M5979</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2023-04-13T07:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869524#M5980</link>
      <description>SAS Studio&lt;BR /&gt;&lt;BR /&gt;PROC IML;&lt;BR /&gt;A={1 1, 0 0};&lt;BR /&gt;t=2;&lt;BR /&gt;X=ExpMatrix (T*A);&lt;BR /&gt;ExactAnswer = ( exp (t) | | t* exp(t) ) //&lt;BR /&gt;( 0 | | exp (t) );&lt;BR /&gt;Print X, ExactAnswer;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Sorry , the excel VBA macros I can not provide now.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Apr 2023 08:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869524#M5980</guid>
      <dc:creator>Davidova</dc:creator>
      <dc:date>2023-04-13T08:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869530#M5981</link>
      <description>&lt;P&gt;I don't think I can offer much help.&amp;nbsp; You can see the source code for the function ExpMatrix from the IML library.&amp;nbsp; Look for the library &lt;SPAN&gt;catalog called SASHELP.IML, and then you can double-click on ExpMatrix to view the source, it is possible that you are using a different algorithm in VBA that would account for the differences.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 09:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869530#M5981</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2023-04-13T09:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869544#M5982</link>
      <description>&lt;P&gt;Here are a few comments:&lt;/P&gt;
&lt;P&gt;1. Your &lt;SPAN&gt;ExactAnswer&amp;nbsp;computation is wrong. It looks like you copied the documentation example but then changed the matrix. The doc says, "For the matrix used in the example...," but you are not using the matrix in the example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. I do not know how Excel implements the matrix exponential, but the computation is notoriously difficult. Two excellent numerical analysts (Moler and van Loan) published a famous paper titled, &lt;A href="https://www.cs.jhu.edu/~misha/ReadingSeminar/Papers/Moler03.pdf" target="_self"&gt;"Nineteen dubious ways to compute the exponential of a matrix."&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. The EXPMATRIX function in IML uses a Pade approximation (reference in doc). For a 2x2 matrix, you can check the computation by applying Putzer's 2x2 formula for the matrix exponential. &lt;A href="http://www.math.utah.edu/~gustafso/debook/chapters/11.pdf#page=55" target="_self"&gt;See p. 866-867 of Gustafson (2022)&amp;nbsp;&lt;/A&gt;&lt;EM&gt;Differential Equations and Linear Algebra&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The following IML program implements the 2x2 case for real eigenvalues:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
A={1 1, 
   0 0};
t=2;

/* call the built-in EXPMATRIX module */
expMat=ExpMatrix (t*A);
Print expMat;

/* implement Putzen's 2x2 formula for real eigenvalues */
start Putzen2x2(A, t);
   eval = eigval(A);
   /* assume eigenvalues are real */
   lambda1 = eval[1,1];
   lambda2 = eval[2,1];
   r1 = exp(lambda1*t);
   r2 = (exp(lambda1*t) - exp(lambda2*t))/(lambda1-lambda2);
   expAt = r1*I(2) + r2*(A-lambda1*I(2));
   return expAt;
finish;

Putzen = Putzen2x2(A, t);
print Putzen;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Both methods report that exp(2*A) is&lt;/P&gt;
&lt;P&gt;{7.3890561 6.3890561,&lt;BR /&gt;&amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P&gt;so there is no evidence that the IML computation is not accurate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 10:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869544#M5982</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-04-13T10:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869554#M5983</link>
      <description>Thanks for your comments! I appreciate your support!</description>
      <pubDate>Thu, 13 Apr 2023 11:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrix-exponential/m-p/869554#M5983</guid>
      <dc:creator>Davidova</dc:creator>
      <dc:date>2023-04-13T11:43:48Z</dc:date>
    </item>
  </channel>
</rss>

