<?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: exponential function error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717454#M221880</link>
    <description>&lt;P&gt;Thank you so much for your help, FreelanceReinhard.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Feb 2021 21:51:15 GMT</pubDate>
    <dc:creator>joon1</dc:creator>
    <dc:date>2021-02-07T21:51:15Z</dc:date>
    <item>
      <title>exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716721#M221549</link>
      <description>&lt;P&gt;Dear Madam/Sir,&lt;/P&gt;&lt;P&gt;I construct "r1" variable using financial data and calculate "pbp" with exponential function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;r1=-1.32-0.407 *size + 6.03*TLTA - 1.43*WCTA + 0.0757*CLCA - 2.37*NITA - 1.83*FUTL + 0.285*INTWO - 1.72*OENEG - 0.521*CHIN;&lt;BR /&gt;pbp=1/(1+exp(-r1));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I have the following error message and many "pbp" value generates missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function EXP(1077.0290778) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(730.03261995) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(2948.7729907) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(1961.5518226) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(755.8640734) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(1152.1594476) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(950.27392335) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(2908.9920974) at line 226 column 10.&lt;BR /&gt;NOTE: Invalid argument to function EXP(947.47746471) at line 226 column 10.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It will be highly appreciative if you can advise me how to resolve this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Joon1&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 02:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716721#M221549</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2021-02-04T02:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716724#M221550</link>
      <description>&lt;P&gt;&lt;SPAN&gt;EXP(755.8640734)&amp;nbsp;is&amp;nbsp;1.851809 × 10^328&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That's a number larger than 10^308 that IEEE 754 computers can store.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;What do you want to do with a 328-digit number?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 03:18:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716724#M221550</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-02-04T03:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716725#M221551</link>
      <description>&lt;P&gt;Take a look at documentation for the CONSTANT function (not the EXP function) at&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0l7s11dwvzfq5n1wnw997dye8fx.htm&amp;amp;locale=en" target="_self"&gt;Constant Function&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In there it says this about the constant "LOGBIG":&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-details"&gt;
&lt;DIV id="p0ikibbq5toigtn1uumh7qkk5j7s" class="xis-subTopic"&gt;
&lt;DIV id="p1r8kbdigiws2wn14iucofl6ajwc" class="xis-topicContent"&gt;
&lt;DIV id="p0njp9dxsdyy61n1powhg4pweaxd" class="xis-paragraph"&gt;You can exponentiate any floating-point number less than or equal to CONSTANT('LOGBIG') by using the exponential function, EXP, without causing any overflows.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-details"&gt;
&lt;DIV id="p0ikibbq5toigtn1uumh7qkk5j7s" class="xis-subTopic"&gt;
&lt;DIV id="p1r8kbdigiws2wn14iucofl6ajwc" class="xis-topicContent"&gt;
&lt;DIV class="xis-paragraph"&gt;So let's see what this value is on my windows machine:&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 lb=constant('logbig');
 put lb=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
which generates:&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lb=709.78271289&lt;/CODE&gt;&lt;/PRE&gt;
Your arguments are too big to be exponentiated on a windows machine using double-precision floating point arithmetic, because they would exponentiate to a value larger than constant('big') [&amp;nbsp;=1.797693E308 on my machine].&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Feb 2021 03:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716725#M221551</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-02-04T03:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716726#M221552</link>
      <description>&lt;P&gt;Trying to calculate a power of e, which is about 2.718, with a large number like 1,000 will result in such an impossibly large number that SAS cannot handle. Even e to the power of 100 will result in a number with 43 zeroes on the end of it! You need to consider limiting the range of values being supplied to the EXP function to something reasonable. PBP will be very close to 0 for large values coming from EXP.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 03:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716726#M221552</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-02-04T03:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716774#M221587</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/107110"&gt;@joon1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you're working with a logistic regression model and you want to apply the logistic function (i.e., the inverse of the logit function) to &lt;FONT face="courier new,courier"&gt;r1&lt;/FONT&gt;. You don't need to type in the formula for the logistic function because SAS has already implemented it in the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=ds2ref&amp;amp;docsetTarget=n0tb2ep52909pjn1dv0fa97tsh0o.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;LOGISTIC function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
do r1=-5, -10, -50, -100, -500, -1000;
  pbp=logistic(r1);
  output;
end;
run;

proc print data=test;
format pbp best21.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;Obs       r1                      pbp

 1        -5         0.00669285092428
 2       -10          0.0000453978687
 3       -50      1.9287498479639E-22
 4      -100      3.7200759760208E-44
 5      -500     7.1245764067411E-218
 6     -1000                        0&lt;/PRE&gt;
&lt;P&gt;The result &lt;FONT face="courier new,courier"&gt;pbp=0&lt;/FONT&gt; for &lt;FONT face="courier new,courier"&gt;r1=-1000&lt;/FONT&gt; is, of course, rounded down from &lt;FONT face="courier new,courier"&gt;5.076E-435&lt;/FONT&gt;, but the unavoidable rounding errors of the other results are much greater than this and you don't get missing values or pesky notes in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 09:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/716774#M221587</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-02-04T09:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717452#M221878</link>
      <description>&lt;P&gt;Thank you so much for your help, mkeintz.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 21:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717452#M221878</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2021-02-07T21:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717453#M221879</link>
      <description>&lt;P&gt;Thank you so much for your help, SASkiwi.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 21:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717453#M221879</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2021-02-07T21:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: exponential function error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717454#M221880</link>
      <description>&lt;P&gt;Thank you so much for your help, FreelanceReinhard.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 21:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exponential-function-error/m-p/717454#M221880</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2021-02-07T21:51:15Z</dc:date>
    </item>
  </channel>
</rss>

