<?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: What is the difference of diagnose.setOption('holdout') and forecast.setOption('holdout')?? in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/What-is-the-difference-of-diagnose-setOption-holdout-and/m-p/530724#M3417</link>
    <description>&lt;P&gt;All options for diagnose object determine how to choose best models from model families; all options for forecast objects determine how to choose the best model from model selection list.&lt;/P&gt;
&lt;P&gt;For example, in this example code, ARIMA and ESM model families are enabled, so the&amp;nbsp;diagnose.setOption('holdout')&amp;nbsp; helps choose one model from ARIMA family and one model from ESM family. If you don't set this option explicitly, it will use the default value 0 for holdout. After you already have a list of models, the forecast object&amp;nbsp;forecast.setOption('holdout') helps select the best model among this list. If you don't set this option explicitly, it will use the default value 0 for holdout when making this decision.&lt;/P&gt;
&lt;P&gt;So in your case, when you want to use non-zero holdout, you might want to specify this options in both objects to be consistent.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jan 2019 19:05:59 GMT</pubDate>
    <dc:creator>YueLi</dc:creator>
    <dc:date>2019-01-28T19:05:59Z</dc:date>
    <item>
      <title>What is the difference of diagnose.setOption('holdout') and forecast.setOption('holdout')??</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/What-is-the-difference-of-diagnose-setOption-holdout-and/m-p/530530#M3415</link>
      <description>&lt;P&gt;HI, i'm using Visual Forecasting.&lt;/P&gt;&lt;P&gt;While using atsm package in TSMODEL procedure, I wonder the difference&amp;nbsp;&lt;/P&gt;&lt;P&gt;diagnose.setOption('holdout', 6);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;forecast.setOption('holdout',6).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**i'm using Auto-forecasting node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tsmodel data = &amp;amp;vf_libIn.."&amp;amp;vf_inData"n
          %if "&amp;amp;vf_inEventObj" ne "" %then %do;
             inobj = (&amp;amp;vf_inEventObj)
          %end;
             outobj = (
                       outfor  = &amp;amp;vf_libOut.."&amp;amp;vf_outFor"n
                       outstat = &amp;amp;vf_libOut.."&amp;amp;vf_outStat"n
                       outmodelinfo = &amp;amp;vf_libOut.."&amp;amp;vf_outModelInfo"n
                       )
             outlog  = &amp;amp;vf_libOut.."&amp;amp;vf_outLog"n          
                  ;
    *define time series ID variable and the time interval;
    id &amp;amp;vf_timeID interval = &amp;amp;vf_timeIDInterval;

    *define time series and the corresponding accumulation methods;
    %vf_varsTSMODEL;

    *define the by variables if exist;
    %if "&amp;amp;vf_byVars" ne "" %then %do;
       by &amp;amp;vf_byVars;
    %end;

    *using the ATSM (Automatic Time Series Model) package;
    require atsm;

    *starting user script;
    submit;

        *declaring the ATSM objects;
        /*
        TSDF:     Time series data frame used to group series variables for DIAGNOSE and FORENG objects
        DIAGNOSE: Automatic time series model generation
        FORENG:   Automatic time series model selection and forecasting
        DIAGSPEC: Diagnostic control options for DIAGNOSE object
        OUTFOR:   Collector for FORENG forecasts
        OUTSTAT:  Collector for FORENG forecast performance statistics
        */
        declare object diagnose(diagnose);
        declare object diagspec(diagspec);
        declare object dataframe(tsdf);
        declare object forecast(foreng);
        declare object outfor(outfor);
        declare object outstat(outstat);
        declare object outmodelinfo(outmodelinfo);

        *initialize the tsdf object and assign the time series roles;
        rc = dataframe.initialize();
        rc = dataframe.addY(&amp;amp;vf_depVar);
        *add independent variables to the tsdf object if there is any;
        %if "&amp;amp;vf_indepVars" ne "" %then %do;
            %vf_addXTSMODEL(dataframe);
        %end;
        %if "&amp;amp;vf_inEventObj" ne "" or "&amp;amp;vf_events" ne "" %then %do;
            declare object ev1(event);
            rc = ev1.Initialize();
            %vf_addEvents(dataframe, ev1);
        %end;

        *open the diagspec object and enable ESM and ARIMAX model class for diagnose;
        rc = diagspec.open();
        rc = diagspec.setESM();
        rc = diagspec.setARIMAX();
        rc = diagspec.setOption('criterion',"&amp;amp;_modelSelection_criteria");
        rc = diagspec.close();

        *set the diagnose object using the diagspec object and run the diagnose process;
        rc = diagnose.initialize(dataframe);
        rc = diagnose.setSpec(diagspec);
/*holdout1
        rc = diagnose.setOption('holdout', 6);*/
        rc = diagnose.run();

        *initialize the foreng object with the diagnose result and run model selecting and generate forecasts;
        rc = forecast.initialize(diagnose);
        rc = forecast.setOption('criterion',"&amp;amp;_modelSelection_criteria");
        rc = forecast.setOption('lead',&amp;amp;vf_lead);
        rc = forecast.setOption('horizon',&amp;amp;vf_horizonStart);
/*holdout2
        rc = forecast.setOption('holdout',6);*/
        rc = forecast.setOption('minobs.trend',2);
        rc = forecast.setOption('minobs.mean',2);
        %if "&amp;amp;vf_allowNegativeForecasts" eq "FALSE" %then %do;
            rc = forecast.setOption('fcst.bd.lower',0);
        %end;
        rc = forecast.run();

        *collect the forecast and statistic-of-fit from the forgen object run results;
        rc = outfor.collect(forecast);
        rc = outstat.collect(forecast);
        rc = outmodelinfo.collect(forecast);
    endsubmit;
quit;

*generate outinformation CAS table;
data &amp;amp;vf_libOut.."&amp;amp;vf_outInformation"n;
    set work.sforecast_outInformation;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to works these code on model?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the difference with the result of model A and model B?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;model A : (add this code)&amp;nbsp;&lt;CODE class=" language-sas"&gt;/*holdout1*/ rc = diagnose.setOption('holdout',6);&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;model B : (add this code)&lt;CODE class=" language-sas"&gt;/*holdout2*/ rc = forecast.setOption('holdout',6);&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="&amp;lt;result&amp;gt;" style="width: 686px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26613iE3B55546399B3402/image-dimensions/686x72?v=v2" width="686" height="72" role="button" title="11.png" alt="&amp;lt;result&amp;gt;" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;&amp;lt;result&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Thank u &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="&amp;lt;result&amp;gt;" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26613iE3B55546399B3402/image-size/large?v=v2&amp;amp;px=999" role="button" title="11.png" alt="&amp;lt;result&amp;gt;" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;&amp;lt;result&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 02:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/What-is-the-difference-of-diagnose-setOption-holdout-and/m-p/530530#M3415</guid>
      <dc:creator>EJ2</dc:creator>
      <dc:date>2019-01-28T02:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference of diagnose.setOption('holdout') and forecast.setOption('holdout')??</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/What-is-the-difference-of-diagnose-setOption-holdout-and/m-p/530724#M3417</link>
      <description>&lt;P&gt;All options for diagnose object determine how to choose best models from model families; all options for forecast objects determine how to choose the best model from model selection list.&lt;/P&gt;
&lt;P&gt;For example, in this example code, ARIMA and ESM model families are enabled, so the&amp;nbsp;diagnose.setOption('holdout')&amp;nbsp; helps choose one model from ARIMA family and one model from ESM family. If you don't set this option explicitly, it will use the default value 0 for holdout. After you already have a list of models, the forecast object&amp;nbsp;forecast.setOption('holdout') helps select the best model among this list. If you don't set this option explicitly, it will use the default value 0 for holdout when making this decision.&lt;/P&gt;
&lt;P&gt;So in your case, when you want to use non-zero holdout, you might want to specify this options in both objects to be consistent.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 19:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/What-is-the-difference-of-diagnose-setOption-holdout-and/m-p/530724#M3417</guid>
      <dc:creator>YueLi</dc:creator>
      <dc:date>2019-01-28T19:05:59Z</dc:date>
    </item>
  </channel>
</rss>

