<?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: PROC IML to solve non-linear equation in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766738#M5641</link>
    <description>&lt;P&gt;Thank you very much for the comment.&lt;/P&gt;
&lt;P&gt;In the equation, &lt;STRONG&gt;p&lt;/STRONG&gt;, denote the stock price; &lt;STRONG&gt;r&lt;/STRONG&gt;, denote a discount rate; all the vars (p,B,F,g,r) are specific to each stock.&lt;/P&gt;
&lt;P&gt;By solving the equation, I want to estimate the values of &lt;STRONG&gt;r&lt;/STRONG&gt;, for &lt;U&gt;each stock and year (y).&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I want a solution using proc IML because it is advised that it’s most suitable to solve problems like this. I want to learn how to use porc IML for this equation, with the hope to solve other problems like this. It’s a learning process for me, and hope the solution can benefit other SAS users as well.&lt;/P&gt;
&lt;P&gt;Please feel free to comment if more info needed, thank you for the help.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 01:03:45 GMT</pubDate>
    <dc:creator>MAC1430</dc:creator>
    <dc:date>2021-09-09T01:03:45Z</dc:date>
    <item>
      <title>PROC IML to solve non-linear equation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766291#M5636</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I need to calculate the unknown discount rate r in the equation below, all the other variables in the model are known.&lt;/P&gt;
&lt;P&gt;Anyone knows how to solve the equation below using &lt;U&gt;PROC IML,&lt;/U&gt; Froot function please?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MAC1430_0-1630989803270.png" style="width: 589px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63340iF68D5B1CC1516F40/image-dimensions/589x93?v=v2" width="589" height="93" role="button" title="MAC1430_0-1630989803270.png" alt="MAC1430_0-1630989803270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A data sample looks like below:&lt;/P&gt;
&lt;PRE&gt;data test;
input stock$     y	B	P	F	g;
datalines;
A	1	12.1492	80.16	3.8886	0.3038
A	2	15.3785	63.54	4.8659	0.3769
A	3	11.5507	41.19	4.5454	0.205
A	4	15.1777	35.28	4.3858	0.1478
A	5	14.9545	52	5.7079	0.0644
A	6	15.8837	50.78	6.1861	-0.0636
A	7	19.3065	67.64	6.7226	-0.0915
A	8	21.6415	72.05	7.7686	-0.0553
A	9	23.6561	74.51	8.804	0.0005
A	10	27.2373	43.05	9.0739	0.123
B	1	6.3668	37.8	2.7893	0.3038
B	2	7.6967	35.4	3.238	0.3769
B	3	8.6812	29.3	3.2122	0.205
B	4	8.999	30.9	3.2352	0.1478
B	5	9.5064	29.75	3.5381	0.0644
B	6	10.1293	39.3	3.4308	-0.0636
B	7	12.2344	43.3	3.7561	-0.0915
B	8	13.2885	52	4.2523	-0.0553
B	9	13.9864	41.6	4.7464	0.0005
B	10	14.043	50.2	4.2598	0.123
C	1	1.4639	24.19	0.3939	0.3038
C	2	2.3384	19.52	1.3403	0.3769
C	3	2.626	7.96	-1.0251	0.205
C	4	2.7283	15.72	0.3156	0.1478
C	5	2.3651	11.81	0.049	0.0644
C	6	2.8771	16.9	0.964	-0.0636
C	7	3.532	18.84	1.1485	-0.0915
C	8	4.5199	21.66	2.0169	-0.0553
C	9	4.379	12.75	2.0582	0.0005
C	10	4.6028	24	0.9412	0.123
;
&lt;/PRE&gt;
&lt;P&gt;If you know the solution to the problem, please comment, thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 04:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766291#M5636</guid>
      <dc:creator>MAC1430</dc:creator>
      <dc:date>2021-09-07T04:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML to solve non-linear equation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766329#M5637</link>
      <description>&lt;P&gt;Another member has already helped me finding the solution using Proc fcmp. &lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Solving-Equation/m-p/766280#M242843" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Solving-Equation/m-p/766280#M242843&lt;/A&gt;&lt;BR /&gt;I am wondering if someone can help me to find solution using Proc IML. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 23:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766329#M5637</guid>
      <dc:creator>MAC1430</dc:creator>
      <dc:date>2021-09-07T23:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML to solve non-linear equation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766338#M5638</link>
      <description>&lt;P&gt;That is a strange formula. Usually time series formulas use "lags," but yours has "leads." You have to tell us how you intend to evaluate the equation at&amp;nbsp;the end of the time series. Your example data has y=1:10. Tell us how you want to evaluate expressions such as F_{y+tau} when y=10, for tau=1:5.&amp;nbsp; When I look at your formula for y=10, I see&lt;/P&gt;
&lt;P&gt;p_10 = B_10 + (TERMS_I_CANT_EVALUATE)&lt;/P&gt;
&lt;P&gt;Do you only want solutions for y&amp;lt;=5?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 10:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766338#M5638</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-09-07T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML to solve non-linear equation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766501#M5639</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;
&lt;P&gt;Yes, solution for y&amp;lt;=5 would be great, assuming the first 5 year are known data, last 5 year are forecast data.&lt;/P&gt;
&lt;P&gt;Please let me know if you need more information, thank you for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 23:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766501#M5639</guid>
      <dc:creator>MAC1430</dc:creator>
      <dc:date>2021-09-07T23:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML to solve non-linear equation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766537#M5640</link>
      <description>&lt;P&gt;In the formula, the rate, r, does not have a subscript, so the equations imply that there is a single value of r that solves these equations simultaneously for all values of the time index, y.&amp;nbsp; However, in the previous thread, you marked a correct solution, and that program computes a different rate for each value of the time index.&amp;nbsp; Is that really what you want? Or are you trying to find a value of r that solves the equations in a least-squares sense?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I guess I am confused by whether the equation is supposed to be solved FOR EACH index, y, or for ALL indices simultaneously, which&amp;nbsp;requires finding a least-squares solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am also wondering why you want to solve this problem by using SAS/IML, if you already have a solution by using the DATA step? What are you hoping to gain from a second solution?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 09:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766537#M5640</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-09-08T09:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML to solve non-linear equation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766738#M5641</link>
      <description>&lt;P&gt;Thank you very much for the comment.&lt;/P&gt;
&lt;P&gt;In the equation, &lt;STRONG&gt;p&lt;/STRONG&gt;, denote the stock price; &lt;STRONG&gt;r&lt;/STRONG&gt;, denote a discount rate; all the vars (p,B,F,g,r) are specific to each stock.&lt;/P&gt;
&lt;P&gt;By solving the equation, I want to estimate the values of &lt;STRONG&gt;r&lt;/STRONG&gt;, for &lt;U&gt;each stock and year (y).&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I want a solution using proc IML because it is advised that it’s most suitable to solve problems like this. I want to learn how to use porc IML for this equation, with the hope to solve other problems like this. It’s a learning process for me, and hope the solution can benefit other SAS users as well.&lt;/P&gt;
&lt;P&gt;Please feel free to comment if more info needed, thank you for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 01:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-to-solve-non-linear-equation/m-p/766738#M5641</guid>
      <dc:creator>MAC1430</dc:creator>
      <dc:date>2021-09-09T01:03:45Z</dc:date>
    </item>
  </channel>
</rss>

