<?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: Force proc nlin fit through (0,0) in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903571#M40324</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/426087"&gt;@linlin87&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you set x=y=0 in your model equation, you obtain a relationship between the parameters: &lt;FONT face="courier new,courier"&gt;a=-b*exp(-c/d)&lt;/FONT&gt;, so you can eliminate parameter &lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt;&amp;nbsp;(or one of the other parameters&amp;nbsp;if you prefer), use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;parameters b=2 c=0.5 d=1;
model y = b*(1-(1+exp(-c/d))/(1+exp((x-c)/d)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and finally compute a point estimate of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt;&amp;nbsp;from the estimates of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt; using the above relationship (and, with some more work, an approximate standard error and approximate confidence limits for &lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt;&amp;nbsp;from the approximate standard errors of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt;, if needed).&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2023 22:08:21 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2023-11-16T22:08:21Z</dc:date>
    <item>
      <title>Force proc nlin fit through (0,0)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903559#M40323</link>
      <description>&lt;P&gt;Hi SAS communit&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a code like this but I try to force the function to go through 0,0, how do I do this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Help would be brilliant for me thank you so much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlin data=data plots=fit outest=par_outest;
ods output parameterestimates=par_est;
parameters a=1 b=2 c=0.5 d=1;
model y = b+(a-b)/(1+exp((x-c)/d));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2023 20:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903559#M40323</guid>
      <dc:creator>linlin87</dc:creator>
      <dc:date>2023-11-16T20:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Force proc nlin fit through (0,0)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903571#M40324</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/426087"&gt;@linlin87&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you set x=y=0 in your model equation, you obtain a relationship between the parameters: &lt;FONT face="courier new,courier"&gt;a=-b*exp(-c/d)&lt;/FONT&gt;, so you can eliminate parameter &lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt;&amp;nbsp;(or one of the other parameters&amp;nbsp;if you prefer), use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;parameters b=2 c=0.5 d=1;
model y = b*(1-(1+exp(-c/d))/(1+exp((x-c)/d)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and finally compute a point estimate of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt;&amp;nbsp;from the estimates of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt; using the above relationship (and, with some more work, an approximate standard error and approximate confidence limits for &lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt;&amp;nbsp;from the approximate standard errors of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt;, if needed).&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 22:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903571#M40324</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-11-16T22:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Force proc nlin fit through (0,0)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903886#M40342</link>
      <description>&lt;P&gt;See the article, &lt;A href="https://blogs.sas.com/content/iml/2020/09/21/regression-inequality-constraints-sas.html" target="_self"&gt;"Regression with inequality constraints on parameters."&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It shows several examples, starting with simple restrictions and ending with the section "More general linear constraints," which applies to your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, set x=0 and y=0 in your model and solve for &lt;EM&gt;a&lt;/EM&gt; as a function of the other parameters. I obtain&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;a&lt;/EM&gt; = b*(1-t), where t = 1 + exp(-c/d), which simplifies to&lt;BR /&gt;&lt;EM&gt;a&lt;/EM&gt; = -b*exp(-c/d).&lt;/P&gt;
&lt;P&gt;You then use that expression in your PROC NLIN code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlin data=data plots=fit outest=par_outest;
ods output parameterestimates=par_est;
parameters b=2 c=0.5 d=1;
/* constrain the problem to pass through the origin (x,y)=(0,0) */
a = -b*exp(-c/d);
model y = b+(a-b)/(1+exp((x-c)/d));
estimate 'a' -b*exp(-c/d);              /* estimate original parameter */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 11:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Force-proc-nlin-fit-through-0-0/m-p/903886#M40342</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-11-20T11:30:54Z</dc:date>
    </item>
  </channel>
</rss>

