<?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: Prediction intervals for the linear combination of forecasts of an ARIMA model in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168935#M1064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post it at &lt;A _jive_internal="true" data-containerid="2007" data-containertype="14" data-objectid="28" data-objecttype="14" href="https://communities.sas.com/community/support-communities/sas_forecasting" style="color: #0e66ba; background-color: #f0f8fb;"&gt;SAS Forecasting and Econometrics&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Udo@sas is good at it .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jan 2015 13:08:14 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2015-01-05T13:08:14Z</dc:date>
    <item>
      <title>Prediction intervals for the linear combination of forecasts of an ARIMA model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168934#M1063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an estimated ARIMA model, and based on that I have the forecast for the next x periods.&lt;/P&gt;&lt;P&gt;I need the prediction and &lt;STRONG&gt;prediction (forecast) intervals&lt;/STRONG&gt; for the following:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;0.5*&lt;STRONG&gt;forecast_lead_2&lt;/STRONG&gt;+&lt;STRONG&gt;forecast_lead_7&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In the below example the prediction (forecast) is:&lt;/P&gt;&lt;P&gt;&lt;EM style="line-height: 1.5em; font-size: 10pt;"&gt;0.5*&lt;STRONG&gt;118440.4517&lt;/STRONG&gt; + &lt;STRONG&gt;119798.8033&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;How can I calculate intervals?&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;arima&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=sashelp.citimon;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: red; background: white;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; var=CCIUAC(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: red; background: white;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; p=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; q=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: red; background: white;"&gt;f&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; lead=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;12&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; out=forecast;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a general case I need prediction for the linear combination of forecasts with &lt;STRONG&gt;prediction intervals&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 12:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168934#M1063</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-01-05T12:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Prediction intervals for the linear combination of forecasts of an ARIMA model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168935#M1064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post it at &lt;A _jive_internal="true" data-containerid="2007" data-containertype="14" data-objectid="28" data-objecttype="14" href="https://communities.sas.com/community/support-communities/sas_forecasting" style="color: #0e66ba; background-color: #f0f8fb;"&gt;SAS Forecasting and Econometrics&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Udo@sas is good at it .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 13:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168935#M1064</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-05T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Prediction intervals for the linear combination of forecasts of an ARIMA model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168936#M1065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;This paper might be of interest: &lt;A href="http://support.sas.com/resources/papers/proceedings12/341-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/341-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/341-2012.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 15:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168936#M1065</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2015-01-05T15:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Prediction intervals for the linear combination of forecasts of an ARIMA model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168937#M1066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Udo,&lt;/P&gt;&lt;P&gt;The mentioned paper is about combining forecasts of different models. But I have only one model, and I want to forecast (calculate) the linear combination of forecasts of two different periods.&lt;/P&gt;&lt;P&gt;On the other hand the suggested paper contains a description about calculating forecast confidence intervals using the &lt;STRONG&gt;sample cross correlation&lt;/STRONG&gt;. Maybe that idea could be useful in my situation.&lt;/P&gt;&lt;P&gt;I still think it should be possible (somehow) to derive the &lt;SPAN style="text-decoration: line-through;"&gt;cross&lt;/SPAN&gt; correlation between &lt;EM&gt;forecast_lead_2&lt;/EM&gt; and &lt;EM&gt;forecast_lead_7&lt;/EM&gt; simply by using the model parameter estimates.&lt;/P&gt;&lt;P&gt;Or maybe this (linear combination) forecast interval could be directly calculated using the forecast intervals of the original forecasts&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 21:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168937#M1066</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-01-05T21:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Prediction intervals for the linear combination of forecasts of an ARIMA model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168938#M1067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to use the&lt;STRONG&gt; Inpulse Respoonse Function&lt;/STRONG&gt; of the model to get the mentioned forecast intervals:&lt;/P&gt;&lt;P&gt;Each random shock is independent, so I can add the variance (sigma**2) &lt;EM&gt;weighted&lt;/EM&gt; by the IRF. Then take the square root.&lt;/P&gt;&lt;P&gt;This is also how the simple forecast intervals (Standard Errors) are calculated.&lt;/P&gt;&lt;P&gt;Now I only need to be careful with the linear combination. For example the effect of the random shock &lt;STRONG&gt;at lead(2)&lt;/STRONG&gt;&amp;nbsp; - remember, we are calculating std error for lead(7) – is: &lt;STRONG&gt;0.5*irf(0) + irf(5) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Anybody can see a theoretical error in this approach?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PROC VARMAX can be used, to get the IRF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a code:&lt;/P&gt;&lt;P&gt;proc varmax data=sashelp.citimon;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model CCIUAC / dif(CCIUAC(1)) q=1 p=4 /*6*/ method=ml print=(impulse=(simple accum )) lagmax=6 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output out=vforecast lead=12;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sigma=sqrt(586153.48852); /* number copied here from the output of VARMAX*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; array irf[0:7] (1, 0.33369, 0.29371, 0.46347, 0.23512, 0.21355, 0.22610, 0.14592);/*Impulse Response - numbers copied here from the output of VARMAX*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; array airf[0:7];/*Accumulated Impulse Response*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; airf[0]=1; do i=1 to 7; airf&lt;I&gt;=airf[i-1]+irf&lt;I&gt;;end;/*calculating airf from irf*/&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*Calculating StdErr for forecast lead 2*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=0 to 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; std_2+airf&lt;I&gt;**2;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; std_2=sqrt(std_2)*sigma;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*Calculating StdErr for forecast lead 7*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=0 to 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; std_7+airf&lt;I&gt;**2;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; std_7=sqrt(std_7)*sigma;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*Calculating StdErr for the linear combination*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*It is similar to a convolution operator, but you sum the squares*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=0 to 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if 0&amp;lt;=i&amp;lt;=4 then do;/**/&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt; lincomb+airf&lt;I&gt;**2;&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;/*5 and 6*/&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt; lincomb+(airf&lt;I&gt;+0.5*airf[i-5])**2;&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;lincomb=sqrt(lincomb)*sigma;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; putlog sigma= std_2= std_7=&lt;STRONG&gt; lincomb=&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps SAS/IML can do this with less coding.&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 14:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Prediction-intervals-for-the-linear-combination-of-forecasts-of/m-p/168938#M1067</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-01-06T14:17:37Z</dc:date>
    </item>
  </channel>
</rss>

