<?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 Predicting variance for GJR-GARCH model in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829580#M4483</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;I am trying to come up with the predicted values of conditional variance by using the following code (GJR-GARCH model):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc model data = wti;&lt;BR /&gt;parms arch0 .1 arch1 .2 garch1 .75 phi .1;&lt;BR /&gt;y = intercept;&lt;BR /&gt;if zlag(resid.y) &amp;gt; 0 then&lt;BR /&gt;h.y = arch0 + arch1*xlag(resid.y**2,mse.y) + garch1*xlag(h.y,mse.y);&lt;BR /&gt;else&lt;BR /&gt;h.y = arch0 + arch1*xlag(resid.y**2,mse.y) + garch1*xlag(h.y,mse.y) +&lt;BR /&gt;phi*xlag(resid.y**2,mse.y) ;&lt;BR /&gt;fit y / method = marquardt fiml;&lt;BR /&gt;run ;&lt;BR /&gt;quit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data contains daily observations of Stock X returns. I want to run this GJR-GARCH model on yearly basis. The problem is this code does not generate the predicted values of conditional variance. Can you please help in this regard?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aman&lt;/P&gt;</description>
    <pubDate>Sun, 21 Aug 2022 18:07:07 GMT</pubDate>
    <dc:creator>amanjot_42</dc:creator>
    <dc:date>2022-08-21T18:07:07Z</dc:date>
    <item>
      <title>Predicting variance for GJR-GARCH model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829580#M4483</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;I am trying to come up with the predicted values of conditional variance by using the following code (GJR-GARCH model):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc model data = wti;&lt;BR /&gt;parms arch0 .1 arch1 .2 garch1 .75 phi .1;&lt;BR /&gt;y = intercept;&lt;BR /&gt;if zlag(resid.y) &amp;gt; 0 then&lt;BR /&gt;h.y = arch0 + arch1*xlag(resid.y**2,mse.y) + garch1*xlag(h.y,mse.y);&lt;BR /&gt;else&lt;BR /&gt;h.y = arch0 + arch1*xlag(resid.y**2,mse.y) + garch1*xlag(h.y,mse.y) +&lt;BR /&gt;phi*xlag(resid.y**2,mse.y) ;&lt;BR /&gt;fit y / method = marquardt fiml;&lt;BR /&gt;run ;&lt;BR /&gt;quit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data contains daily observations of Stock X returns. I want to run this GJR-GARCH model on yearly basis. The problem is this code does not generate the predicted values of conditional variance. Can you please help in this regard?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aman&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 18:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829580#M4483</guid>
      <dc:creator>amanjot_42</dc:creator>
      <dc:date>2022-08-21T18:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Predicting variance for GJR-GARCH model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829588#M4484</link>
      <description>&lt;P&gt;Moved post to "SAS Forecasting and Econometrics" board&lt;/P&gt;
&lt;P&gt;, and calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/82879"&gt;@SASCom1&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 22:15:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829588#M4484</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-08-21T22:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Predicting variance for GJR-GARCH model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829673#M4485</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/198822"&gt;@amanjot_42&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In PROC MODEL, you can first assign the h.y variable to a temporary variable, say, h_y = h.y, then use the OUTVARS statement with the OUT = dataset option in the FIT statement to output the values of the h.y into the output data set. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;   /* Estimate GJR-GARCH Model */
   proc model data = gjrgarch ;
      parms arch0 .1 arch1 .2 garch1 .75 phi .1;
      /* mean model */
      y = intercept ;
      /* variance model */
      if zlag(resid.y) &amp;gt; 0 then
         h.y = arch0 + arch1*xlag(resid.y**2,mse.y) + garch1*xlag(h.y,mse.y)  ;
      else
         h.y = arch0 + arch1*xlag(resid.y**2,mse.y) + garch1*xlag(h.y,mse.y) +
               phi*xlag(resid.y**2,mse.y) ;&lt;BR /&gt;      h_y = h.y ;
      /* fit the model */
      fit y / method = marquardt fiml out = outdata;&lt;BR /&gt;      outvars h_y ;
   run ;
   quit ;&lt;BR /&gt;&lt;BR /&gt;proc print data = outdata; run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that the GJR-GARCH model can also be specified directly in PROC AUTOREG with option&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TYPE =&amp;nbsp;&lt;SPAN&gt;THRES | THRESHOLD | TGARCH | GJR | GJRGARCH&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;in the MODEL statement. And you can use CEV = option in the OUTPUT statement in PROC AUTOREG to output the conditional error variance in the output data set, for example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;proc autoreg data =gjrgarch ;&lt;BR /&gt;model y = /garch =(p=1,q=1, type = gjr);&lt;BR /&gt;output out = out_auto cev = cev ;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc print data = out_auto; run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please also note that the GJR-GARCH model implemented in PROC AUTOREG has slightly different parameterizations on the indicator function as that specified in the above PROC MODEL step, see the equation for h_t in PROC AUTOREG documentation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_030/etsug/etsug_autoreg_details12.htm#etsug_autoreg005090" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_030/etsug/etsug_autoreg_details12.htm#etsug_autoreg005090&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where the indicator is equal to 1 when epsilon_t &amp;lt; 0, and equal to 0 otherwise. In the PROC MODEL code above, the indicator is for epsilon_t &amp;gt; 0 instead.&amp;nbsp; They are equivalent model with this slightly different parameterizations on the indicator function, and you can convert from one to the other as you wish.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 15:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829673#M4485</guid>
      <dc:creator>SASCom1</dc:creator>
      <dc:date>2022-08-22T15:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Predicting variance for GJR-GARCH model</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829694#M4486</link>
      <description>&lt;P&gt;Thank you so much, This is working really well!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amanjot&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 16:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Predicting-variance-for-GJR-GARCH-model/m-p/829694#M4486</guid>
      <dc:creator>amanjot_42</dc:creator>
      <dc:date>2022-08-22T16:33:55Z</dc:date>
    </item>
  </channel>
</rss>

