<?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 scoring code from proc autoreg - help in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135171#M805</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello group,&lt;/P&gt;&lt;P&gt;I need some help to write scoring code from proc autoreg. What is the actual code that can replicate the predicted quantities from the output out = dataset?&lt;/P&gt;&lt;P&gt;It's easy enough to calculate the predicted model component (using standard coefficients) but how does one incorporate the AR coefficients?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling even with a simple example: consider the example given in SAS online documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_autoreg0009.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_autoreg0010.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_autoreg0011.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; color: black;"&gt;&amp;nbsp;&amp;nbsp; data a; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ul = 0; ull = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do time = -10 to 36;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u = + 1.3 * ul - .5 * ull + 2*rannor(12346);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = 10 + .5 * time + u;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if time &amp;gt; 0 then output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ull = ul; ul = u;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; color: black;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;auto-reg model&lt;/STRONG&gt;&lt;/SPAN&gt; - produce an output dataset with predicted quatitites: &lt;EM&gt;QUESTION: HOW CAN I USE MODEL EFFECTS TO REPLICATE PREDICTED VALUES&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;autoreg&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=a &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;outest&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; = autoreg_parms;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aut: &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;model&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; y = time / &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;nlag&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;method&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=ml;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;output&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; = pred_a &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; = pred_y &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Apr 2014 14:35:01 GMT</pubDate>
    <dc:creator>danilo276</dc:creator>
    <dc:date>2014-04-27T14:35:01Z</dc:date>
    <item>
      <title>scoring code from proc autoreg - help</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135171#M805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello group,&lt;/P&gt;&lt;P&gt;I need some help to write scoring code from proc autoreg. What is the actual code that can replicate the predicted quantities from the output out = dataset?&lt;/P&gt;&lt;P&gt;It's easy enough to calculate the predicted model component (using standard coefficients) but how does one incorporate the AR coefficients?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling even with a simple example: consider the example given in SAS online documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_autoreg0009.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_autoreg0010.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_autoreg0011.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; color: black;"&gt;&amp;nbsp;&amp;nbsp; data a; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ul = 0; ull = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do time = -10 to 36;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u = + 1.3 * ul - .5 * ull + 2*rannor(12346);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = 10 + .5 * time + u;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if time &amp;gt; 0 then output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ull = ul; ul = u;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; color: black;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;auto-reg model&lt;/STRONG&gt;&lt;/SPAN&gt; - produce an output dataset with predicted quatitites: &lt;EM&gt;QUESTION: HOW CAN I USE MODEL EFFECTS TO REPLICATE PREDICTED VALUES&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;autoreg&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=a &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;outest&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; = autoreg_parms;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aut: &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;model&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; y = time / &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;nlag&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;method&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=ml;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;output&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; = pred_a &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; = pred_y &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Apr 2014 14:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135171#M805</guid>
      <dc:creator>danilo276</dc:creator>
      <dc:date>2014-04-27T14:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: scoring code from proc autoreg - help</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135172#M806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two types of predicted values for AR models, conditional and unconditional, depending on your needs. Which one would you like to compute? See&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_autoreg_details52.htm" title="http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_autoreg_details52.htm"&gt;SAS/ETS(R) 13.1 User's Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Apr 2014 17:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135172#M806</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-27T17:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: scoring code from proc autoreg - help</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135173#M807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. I'm after the conditional mean values. The descriptions in the user guide are all nice and well for t &amp;gt; nlag. However, there is nothing on how to start the predicted series: the auto-regressive formula&lt;/P&gt;&lt;P&gt;v_t = -phi_2*v_t-2 - phi_1*v_t-1 (for AR(2) say) doesn't say how to compute v_1 and v_2. This is my whole problem.&lt;/P&gt;&lt;P&gt;Do you know how SAS actually does this?&lt;/P&gt;&lt;P&gt;Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 09:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/scoring-code-from-proc-autoreg-help/m-p/135173#M807</guid>
      <dc:creator>danilo276</dc:creator>
      <dc:date>2014-04-28T09:05:57Z</dc:date>
    </item>
  </channel>
</rss>

