<?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: Floating Point Overflow During AUTOREG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Floating-Point-Overflow-During-AUTOREG/m-p/516317#M139444</link>
    <description>&lt;P&gt;I tried your code and it generates&amp;nbsp;&lt;STRONG&gt;many&lt;/STRONG&gt; errors before this exception:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: QUANEW Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: Optimization cannot improve the function value.
ERROR: QUANEW Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: Optimization cannot improve the function value.
ERROR: QUANEW Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: Optimization cannot improve the function value.
ERROR: Floating Point Overflow.
ERROR: Termination due to Floating Point Exception&lt;/PRE&gt;
&lt;P&gt;I don't know enough about this procedure to judge, but usually errors in the log are an indication that there are larger problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, Floating Point Overflow shouldn't happen, so I think you'll need to work with SAS Tech Support to report and maybe find a workaround.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Nov 2018 14:32:59 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2018-11-27T14:32:59Z</dc:date>
    <item>
      <title>Floating Point Overflow During AUTOREG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Floating-Point-Overflow-During-AUTOREG/m-p/513221#M138264</link>
      <description>&lt;P&gt;The code below&amp;nbsp;simulates 25 GARCH(1,1)&amp;nbsp;processes with 1,000 observations each and estimates their out-of-sample&amp;nbsp;conditional variances based on GARCH(p,q) with p,q∈{1,2,3} using an expanding window starting from 100 observations.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;resetline;
option nodate nonumber ls=128 ps=max;
proc datasets lib=work kill nolist;
run;
data _01;
format I T SIGMA2 U SIGMA21 U1;
call streaminit(1);
do I=1 to 25;
do T=1 to 1000;
if T=1 then do;
SIGMA21=.;
U1=.;
SIGMA2=1;
end;
else SIGMA2=0.1+0.2*U1**2+0.7*SIGMA21;
U=sqrt(SIGMA2)*rand("normal");
output;
SIGMA21=SIGMA2;
U1=U;
end;
end;
run;
%macro REPEAT1;
%do REPEAT=101 %to 1000;
data _99;
T=&amp;amp;REPEAT.;
set _01(rename=(T=T0) where=(T0&amp;lt;=&amp;amp;REPEAT.));
if T0=&amp;amp;REPEAT. then U=.;
run;
proc append base=_98 data=_99;
run;
%end;
%mend;
%REPEAT1;
ods select none;
ods noresults;
proc autoreg;
by T I;
ods output ConvergenceStatus=_96 FitSummary=_97;
model U=/noint garch=(p=1,q=1) maxiter=10000 converge=0.0001;
output out=_95 ht=GARCH11;
model U=/noint garch=(p=1,q=2) maxiter=10000 converge=0.0001;
output out=_94 ht=GARCH12;
model U=/noint garch=(p=1,q=3) maxiter=10000 converge=0.0001;
output out=_93 ht=GARCH13;
model U=/noint garch=(p=2,q=1) maxiter=10000 converge=0.0001;
output out=_92 ht=GARCH21;
model U=/noint garch=(p=2,q=2) maxiter=10000 converge=0.0001;
output out=_91 ht=GARCH22;
model U=/noint garch=(p=2,q=3) maxiter=10000 converge=0.0001;
output out=_90 ht=GARCH23;
model U=/noint garch=(p=3,q=1) maxiter=10000 converge=0.0001;
output out=_89 ht=GARCH31;
model U=/noint garch=(p=3,q=2) maxiter=10000 converge=0.0001;
output out=_88 ht=GARCH32;
model U=/noint garch=(p=3,q=3) maxiter=10000 converge=0.0001;
output out=_87 ht=GARCH33;
run;
ods results;
ods select all;
data _97(keep=T I Model AIC);
set _97(rename=(nValue2=AIC));
where Label2="AIC";
by T I Model;
if last.Model;
run;
proc transpose out=_97(drop=_NAME_) prefix=AIC;
var AIC;
by T I;
run;
proc transpose data=_96 out=_96(drop=_NAME_) prefix=CONV;
var Status;
by T I;
run;
%macro REPEAT2;
%do REPEAT=95 %to 87 %by -1;
proc sort data=_&amp;amp;REPEAT. out=_&amp;amp;REPEAT. nodupkey;
by T I T0;
run;
%end;
%mend;
%REPEAT2;
data _86;
merge _98(where=(T=T0)) _97 _96
_95(where=(T=T0) keep=T I T0 GARCH11)
_94(where=(T=T0) keep=T I T0 GARCH12)
_93(where=(T=T0) keep=T I T0 GARCH13)
_92(where=(T=T0) keep=T I T0 GARCH21)
_91(where=(T=T0) keep=T I T0 GARCH22)
_90(where=(T=T0) keep=T I T0 GARCH23)
_89(where=(T=T0) keep=T I T0 GARCH31)
_88(where=(T=T0) keep=T I T0 GARCH32)
_87(where=(T=T0) keep=T I T0 GARCH33);
by T I;
array AIC(*) AIC1-AIC9;
array CONV(*) CONV1-CONV9;
array GARCHPQ(*) GARCH11--GARCH33;
do J=1 to 9;
if CONV(J)=3 or GARCHPQ(J)=. then AIC(J)=.;
end;
do J=1 to 9;
if AIC(J)=max(of AIC1-AIC9) then GARCH=GARCHPQ(J);
end;
drop T0 J;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I don't think there exists a logical problem in the code, but AUTOREG aborts at some point generating&amp;nbsp;two warning messages "&lt;FONT face="courier new,courier"&gt;ERROR: Floating Point Overflow.&lt;/FONT&gt;" and "&lt;FONT face="courier new,courier"&gt;ERROR: Termination due to Floating Point Exception&lt;/FONT&gt;," respectively. Recursive SAS Macro may be one easy solution, but I want to circumvent the way since it's too costly compared to the code above.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 07:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Floating-Point-Overflow-During-AUTOREG/m-p/513221#M138264</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2018-11-15T07:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Floating Point Overflow During AUTOREG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Floating-Point-Overflow-During-AUTOREG/m-p/516317#M139444</link>
      <description>&lt;P&gt;I tried your code and it generates&amp;nbsp;&lt;STRONG&gt;many&lt;/STRONG&gt; errors before this exception:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: QUANEW Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: Optimization cannot improve the function value.
ERROR: QUANEW Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: Optimization cannot improve the function value.
ERROR: QUANEW Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: Optimization cannot improve the function value.
ERROR: Floating Point Overflow.
ERROR: Termination due to Floating Point Exception&lt;/PRE&gt;
&lt;P&gt;I don't know enough about this procedure to judge, but usually errors in the log are an indication that there are larger problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, Floating Point Overflow shouldn't happen, so I think you'll need to work with SAS Tech Support to report and maybe find a workaround.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 14:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Floating-Point-Overflow-During-AUTOREG/m-p/516317#M139444</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-11-27T14:32:59Z</dc:date>
    </item>
  </channel>
</rss>

