<?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: How to prespecify several initial parameters with nonlinear fit in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166905#M263855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Steven.&amp;nbsp; That should help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Aug 2014 18:57:52 GMT</pubDate>
    <dc:creator>bjbreitling</dc:creator>
    <dc:date>2014-08-19T18:57:52Z</dc:date>
    <item>
      <title>How to prespecify several initial parameters with nonlinear fit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166903#M263853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have several plots with confidence intervals that I would like to plot with sg plot.&amp;nbsp; My issue is that the intial parameters I provide do not allow for very good fits for some of the curves that I would like to fit.&amp;nbsp; I would like to provide different inital conditions for the different curves but the code I found on the web didn't work.&amp;nbsp; Below is the SAS code I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA zein; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; INPUT X Y Zein $; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DATALINES;&lt;/P&gt;&lt;P&gt;0.400091049 78 F4000&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input Parameter Estimate Zein;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;a -3.40 LF0817&lt;/P&gt;&lt;P&gt;b .0000000000595 LF0817&lt;/P&gt;&lt;P&gt;c -31.3 LF0817&lt;/P&gt;&lt;P&gt;d 3451.4 LF0817&lt;/P&gt;&lt;P&gt;f 11.44 LF0817&lt;/P&gt;&lt;P&gt;a -26.9 2323&lt;/P&gt;&lt;P&gt;b .0004 2323&lt;/P&gt;&lt;P&gt;c -13.8 2323&lt;/P&gt;&lt;P&gt;d 1612.8 2323&lt;/P&gt;&lt;P&gt;f 7.06 2323&lt;/P&gt;&lt;P&gt;a -31.4 1223&lt;/P&gt;&lt;P&gt;b .02576 1223&lt;/P&gt;&lt;P&gt;c -8.90 1223&lt;/P&gt;&lt;P&gt;d 1544 1223&lt;/P&gt;&lt;P&gt;f 6.94 1223&lt;/P&gt;&lt;P&gt;a 575.6 F4000&lt;/P&gt;&lt;P&gt;b -492689 F4000&lt;/P&gt;&lt;P&gt;c -2 F4000&lt;/P&gt;&lt;P&gt;d 492362.7 F4000&lt;/P&gt;&lt;P&gt;f -2 F4000&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc nlin data=zein outest=est plots(stats=all)=(diagnostics);&lt;/P&gt;&lt;P&gt;parameters &lt;/P&gt;&lt;P&gt;a=575.6&lt;/P&gt;&lt;P&gt;b=-492689&lt;/P&gt;&lt;P&gt;c=-2&lt;/P&gt;&lt;P&gt;d=492362.7&lt;/P&gt;&lt;P&gt;f=-2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;model Y = a+b*exp(-c*X)+d*exp(-f*X);&lt;/P&gt;&lt;P&gt;BY Zein;&lt;/P&gt;&lt;P&gt;*/ContourFitPlot;&lt;/P&gt;&lt;P&gt;output out=b L95=low U95= up predicted=yp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=b ;&lt;/P&gt;&lt;P&gt;yaxis label='Observed or Predicted';&lt;/P&gt;&lt;P&gt;*/By Zein;&lt;/P&gt;&lt;P&gt;scatter y=Y x=X / group=Zein;&lt;/P&gt;&lt;P&gt;*/band x=X upper=up lower=low;&lt;/P&gt;&lt;P&gt;series y=low x=X / group=Zein curvelabel;&lt;/P&gt;&lt;P&gt;series y=up x=X / group=Zein;&lt;/P&gt;&lt;P&gt;*/series y=yp x=X / group=Zein;&lt;/P&gt;&lt;P&gt;*/series y=yp x=X;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods graphics off;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 13:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166903#M263853</guid>
      <dc:creator>bjbreitling</dc:creator>
      <dc:date>2014-08-19T13:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to prespecify several initial parameters with nonlinear fit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166904#M263854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This model and these parameters look like a train wreck about to happen.&amp;nbsp; With those initial parameters, the two exponential terms essentially cancel one another, and unless you have a lot of data, that negative correlation is going to dominate everything.&amp;nbsp; Some things to consider:&amp;nbsp; Scale X carefully.&amp;nbsp; Try a grid search for starting values, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parms a=0 to 1000 by 200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b= -5 to 5 by 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c= -2 to 2 by 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d= -5 to 5 by 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e= -2 to 2 by 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that still involves over 15,000 initial fits before the model ever starts to be fit iteratively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I see as the problem is that the two pool model you have here is almost certainly overspecified for the data (and that's coming from the king of overspecifying models)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 18:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166904#M263854</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-08-19T18:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to prespecify several initial parameters with nonlinear fit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166905#M263855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Steven.&amp;nbsp; That should help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 18:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-prespecify-several-initial-parameters-with-nonlinear-fit/m-p/166905#M263855</guid>
      <dc:creator>bjbreitling</dc:creator>
      <dc:date>2014-08-19T18:57:52Z</dc:date>
    </item>
  </channel>
</rss>

