<?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: Recursive Function within NLIN Model Expression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900832#M44651</link>
    <description>&lt;P&gt;SAS/STAT® 15.1 User’s Guide&lt;BR /&gt;The NLIN Procedure&lt;BR /&gt;Details: NLIN Procedure ✦ p.6931&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/nlin.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/nlin.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Automatic Derivatives&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;Depending on the optimization method you select, analytical first- and second-order derivatives are computed automatically. Derivatives can still be supplied using the DER.parm syntax. These DER.parm derivatives are not verified by the differentiator. If any needed derivatives are not supplied, they are computed and added to the programming statements. To view the computed derivatives, use the LISTDER or LIST option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2023 22:50:04 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-10-30T22:50:04Z</dc:date>
    <item>
      <title>Recursive Function within NLIN Model Expression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900541#M44642</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to use proc NLIN to fit a model in which two of the parameters in the model statement live in a function that is recursive with respect to an independent variable.&amp;nbsp; That is, the value that the function takes on IV level N is in part determined by value of that same function on IV level N-1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a standard way to manage this recursive issue within NLIN? Ideally, I’m looking for something analogous to the lag function but that can operate on a newly defined function rather than just on variables in the input dataset. Hope this makes sense. Happy to provide more detail if it will help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 22:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900541#M44642</guid>
      <dc:creator>cogprof</dc:creator>
      <dc:date>2023-10-29T22:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive Function within NLIN Model Expression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900542#M44643</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/459688"&gt;@cogprof&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That is, the value that the function takes on IV level N is in part determined by value of that same function on IV level N-1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a standard way to manage this recursive issue within NLIN?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you mean with "&lt;STRONG&gt;IV&lt;/STRONG&gt; level"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a standard way.&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;Make your recursive function with PROC FCMP.&lt;/LI&gt;
&lt;LI&gt;You can subsequently use / call that newly defined function in PROC NLIN !&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation&lt;BR /&gt;Base SAS Procedures Guide&lt;BR /&gt;FCMP Procedure&lt;BR /&gt;Creating Functions and Subroutines&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n16ijqsjbv5mdbn1c6w7j6elpky2.htm#n0sta98lt2j3e5n10xnvjhfcwe5j" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n16ijqsjbv5mdbn1c6w7j6elpky2.htm#n0sta98lt2j3e5n10xnvjhfcwe5j&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;says:&lt;BR /&gt;PROC FCMP enables you to write functions and CALL routines using DATA step syntax. PROC FCMP functions and CALL routines are stored in a data set and can be called from the DATA step, as well as several SAS/STAT, SAS/ETS, or SAS/OR procedures such as the &lt;U&gt;&lt;STRONG&gt;NLIN&lt;/STRONG&gt;&lt;/U&gt;, MODEL, and NLP procedures. You can create multiple functions and CALL routines in a single FCMP procedure step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation&lt;BR /&gt;Base SAS Procedures Guide&lt;BR /&gt;FCMP Procedure&lt;BR /&gt;Recursion&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1712ebq466zztn1qli0vyf0e4v8.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1712ebq466zztn1qli0vyf0e4v8.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;says:&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;PROC FCMP routines can be recursive.&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;A recursive function is a function that calls itself, either directly or indirectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 22:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900542#M44643</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-29T22:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive Function within NLIN Model Expression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900734#M44647</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;What do you mean with "&lt;STRONG&gt;IV&lt;/STRONG&gt; level"?&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;IV&lt;/STRONG&gt; = &lt;U&gt;&lt;STRONG&gt;I&lt;/STRONG&gt;&lt;/U&gt;ndependent &lt;U&gt;&lt;STRONG&gt;V&lt;/STRONG&gt;&lt;/U&gt;ariable&lt;/P&gt;
&lt;P&gt;, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 16:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900734#M44647</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-30T16:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive Function within NLIN Model Expression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900759#M44648</link>
      <description>&lt;P&gt;Thank you Koen.&amp;nbsp; I'll find time soon to look into using FCMP.&amp;nbsp; I'd like to keep this thread open as I'm sure I will have some questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For now I have just one question:&amp;nbsp; If I calculate the value of the recursive function within FCMP, how is NLIN going to calculate the first and second partial derivatives for the parameters within that function? I don't know know how to calculate them so can't enter it manually.&amp;nbsp; Can it default to computational approximation?&amp;nbsp; I ask this question now because if NLIN can't handle that then it may not be worth my efforts to explore using FCMP.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 17:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900759#M44648</guid>
      <dc:creator>cogprof</dc:creator>
      <dc:date>2023-10-30T17:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive Function within NLIN Model Expression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900832#M44651</link>
      <description>&lt;P&gt;SAS/STAT® 15.1 User’s Guide&lt;BR /&gt;The NLIN Procedure&lt;BR /&gt;Details: NLIN Procedure ✦ p.6931&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/nlin.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/nlin.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Automatic Derivatives&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;Depending on the optimization method you select, analytical first- and second-order derivatives are computed automatically. Derivatives can still be supplied using the DER.parm syntax. These DER.parm derivatives are not verified by the differentiator. If any needed derivatives are not supplied, they are computed and added to the programming statements. To view the computed derivatives, use the LISTDER or LIST option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 22:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Recursive-Function-within-NLIN-Model-Expression/m-p/900832#M44651</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-30T22:50:04Z</dc:date>
    </item>
  </channel>
</rss>

