<?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: WARNING: PROC NLIN failed to converge error in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444700#M23338</link>
    <description>&lt;P&gt;I think they are all correct except for der.B, so just delete that line and see what happens. But, yes, you could also delete all four lines.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Mar 2018 10:28:05 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-03-12T10:28:05Z</dc:date>
    <item>
      <title>WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444529#M23329</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I resolve the 'PROC NLIN failed to converge.' error? Here is the code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT DATAFILE="/folders/myfolders/Brook trout temp-final.xlsx"
OUT=brooktrout
DBMS=XLSX
REPLACE;
RUN;
title 'Gastric evacuation in brook trout - SQRT model +AC (12.5-20.4)';
data exp;
set brooktrout;
if expno=1 or expno=2 or expno=4 or expn=5 or expno=6 or expno=7 or expno=8;
run;
proc nlin data=exp method=marquardt;
parms RLT=0.0013 A=0.05 B=0.46 TU=20;
C=1.31;
R=RLT*predlcm**C*EXP(A*temp)*(1-EXP(B*(temp-TU)));
model sqrtstw=sqrtsow-0.5*R*time;
der.RLT=-0.5*predlcm**C*EXP(A*temp)*(1-EXP(B*(temp-TU)))*time;
der.A=-0.5*RLT*predlcm**C*temp*EXP(A*temp)*(1-EXP(B*(temp-TU)))*time;
der.B=-0.5*RLT*predlcm**C*EXP(A*temp)*(20-temp)*EXP(B*(temp-TU))*time;
der.TU=-0.5*RLT*predlcm**C*EXP(A*temp)*B*EXP(B*(temp-TU))*time;
 
output out=expp p=pstw r=stw_residual;
run;
proc summary data=expp;
var stw_residual stw;
output out=stats css(stw)=sstot uss(stw_residual)=ssres N=N;
run;
data expp;
set stats;
rsquared=1-(ssres/sstot);
adjrsquared = 1-(1-rsquared)*(N-1) / (N- 3 -1);
run;
proc print data=expp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 09:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444529#M23329</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2018-03-11T09:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444613#M23333</link>
      <description>&lt;P&gt;You should begin by checking your derivatives, which look wrong to me. In particular, der.B has the term (20-temp), which I think should be (TU-temp).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, there is really no need to write your own derivatives. PROC NLIN will automatically generate analytical derivatives.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 13:12:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444613#M23333</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-12T13:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444644#M23334</link>
      <description>&lt;P&gt;Dear Rick_SAS,&lt;/P&gt;&lt;P&gt;Could you please&amp;nbsp;write it as Proc statement in a comment?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 06:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444644#M23334</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2018-03-12T06:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444697#M23336</link>
      <description>&lt;P&gt;If you don't know how to take the derivative of the exponential&amp;nbsp;term and apply the chain rule, then just delete the&amp;nbsp;incorrect statement and NLIN will generate it for you.&amp;nbsp; Good luck!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 10:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444697#M23336</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-12T10:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444698#M23337</link>
      <description>&lt;P&gt;You mean I should simply delete these lines:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;der.RLT=-0.5*predlcm**C*EXP(A*temp)*(1-EXP(B*(temp-TU)))*time;
der.A=-0.5*RLT*predlcm**C*temp*EXP(A*temp)*(1-EXP(B*(temp-TU)))*time;
der.B=-0.5*RLT*predlcm**C*EXP(A*temp)*(20-temp)*EXP(B*(temp-TU))*time;
der.TU=-0.5*RLT*predlcm**C*EXP(A*temp)*B*EXP(B*(temp-TU))*time;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 10:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444698#M23337</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2018-03-12T10:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444700#M23338</link>
      <description>&lt;P&gt;I think they are all correct except for der.B, so just delete that line and see what happens. But, yes, you could also delete all four lines.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 10:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444700#M23338</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-12T10:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444701#M23339</link>
      <description>I received the same error (PROC NLIN failed to converge.) again though I removed above mentioned lines.&lt;BR /&gt;&lt;BR /&gt;P.S. Today I learn one new thing that writing derivatives are not essential. It will make my life easy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 12 Mar 2018 10:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444701#M23339</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2018-03-12T10:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444702#M23340</link>
      <description>&lt;P&gt;Great. Two common&amp;nbsp;reasons why a model might not converge is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. The model does not fit your data.&lt;/P&gt;
&lt;P&gt;2. The initial guesses are not sufficiently close to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;actual&amp;nbsp;parameter estimates for your model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't do anything about (1). If the problem is (2) then you can specify several parameter values on the PARMS statement. For example, if you are not sure about the parameter values for A ant TU, you can specify multiple guesses:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;parms RLT=0.0013 
           A=0.05 0.1    /* 2 guesses */
           B=0.46 
           TU=15 20 25; /* 3 guesses */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Mar 2018 10:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444702#M23340</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-12T10:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444708#M23341</link>
      <description>I provided multiple guesses but again didn't work. The model adequately fit to my data and provides a best curve line.&lt;BR /&gt;By the way, along with converge error I also get one more error which is: "WARNING: Maximum number of iterations exceeded"!</description>
      <pubDate>Mon, 12 Mar 2018 12:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444708#M23341</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2018-03-12T12:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444713#M23344</link>
      <description>&lt;P&gt;In the IF statement of your DATA EXP step, you need to change to EXPNO=5.&amp;nbsp; Currently, all those observations are not part of the data that you are analyzing. That will make a difference, especially if there are many observations that have EXPON=5.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 12:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444713#M23344</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-12T12:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: PROC NLIN failed to converge error</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444718#M23345</link>
      <description>&lt;P&gt;Thanks for the correction. I was making a small mistake (in derivatives as well as in guesses). I should first&amp;nbsp;fix the "A" with the value I need to calculate separately using exponential function. Now the&amp;nbsp;Convergence criterion met successfully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;very much for your help. I always learn new things at this&amp;nbsp;platform &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 12:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/WARNING-PROC-NLIN-failed-to-converge-error/m-p/444718#M23345</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2018-03-12T12:56:53Z</dc:date>
    </item>
  </channel>
</rss>

