<?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 How to read the result of GRJ-GARCH model? in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/922385#M4792</link>
    <description>&lt;P&gt;Dear Helpers, I want to run GRJ-Garch model. Two versions of code I have tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Version 1: from the following webpage&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Code-Examples/Estimating-GARCH-Models/ta-p/905609#ets_webex.garchex.tgarch" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Code-Examples/Estimating-GARCH-Models/ta-p/905609#ets_webex.garchex.tgarch&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&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) ;
      /* fit the model */
      fit y / method = marquardt fiml ;
   run ;
   quit ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Version 2: I modified from what I read from the manual. "type = grjgarch"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc autoreg data=oneCoin ;
   model ret =    / nlag=1 garch=(p=1, q=1, type=gjrgarch) ; 
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the version 1, I understand the variable of interest is phi. But I do not know how to read the output of the Version 2. Although I read page 402 in the below manual, I do not know what shows in my below snapshot. Could you please help me understand?&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/ets/132/autoreg.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/documentation/onlinedoc/ets/132/autoreg.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gigiwen_0-1711907174894.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95046i5C1B1AC68A216DE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gigiwen_0-1711907174894.png" alt="Gigiwen_0-1711907174894.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, I also wish to understand whether Version 1 and 2 are exactly the same? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 31 Mar 2024 17:50:10 GMT</pubDate>
    <dc:creator>Gigiwen</dc:creator>
    <dc:date>2024-03-31T17:50:10Z</dc:date>
    <item>
      <title>How to read the result of GRJ-GARCH model?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/922385#M4792</link>
      <description>&lt;P&gt;Dear Helpers, I want to run GRJ-Garch model. Two versions of code I have tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Version 1: from the following webpage&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Code-Examples/Estimating-GARCH-Models/ta-p/905609#ets_webex.garchex.tgarch" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Code-Examples/Estimating-GARCH-Models/ta-p/905609#ets_webex.garchex.tgarch&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&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) ;
      /* fit the model */
      fit y / method = marquardt fiml ;
   run ;
   quit ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Version 2: I modified from what I read from the manual. "type = grjgarch"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc autoreg data=oneCoin ;
   model ret =    / nlag=1 garch=(p=1, q=1, type=gjrgarch) ; 
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the version 1, I understand the variable of interest is phi. But I do not know how to read the output of the Version 2. Although I read page 402 in the below manual, I do not know what shows in my below snapshot. Could you please help me understand?&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/ets/132/autoreg.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/documentation/onlinedoc/ets/132/autoreg.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gigiwen_0-1711907174894.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95046i5C1B1AC68A216DE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gigiwen_0-1711907174894.png" alt="Gigiwen_0-1711907174894.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, I also wish to understand whether Version 1 and 2 are exactly the same? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 17:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/922385#M4792</guid>
      <dc:creator>Gigiwen</dc:creator>
      <dc:date>2024-03-31T17:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to read the result of GRJ-GARCH model?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/923841#M4809</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/246807"&gt;@Gigiwen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your version 1 PROC MODEL code, you specified a pure GJR-GARCH model without autoregressive errors; in your version 2 PROC AUTOREG code, you specified a GJR-GARCH model with autoregressive errors(with the NLAG = option in your code). If you intended to specify a pure GJR-GARCH model without autoregressive errors, then you may want to remove the NLAG = option in your version 2 PROC AUTOREG code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have removed the NLAG = option in your version 2 PROC AUTOREG code, then both versions specify a GJR-GARCH model without AR errors, but they are equivalent with some re-parameterization as discussed below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your version 1 PROC MODEL code, it specifies that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;      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;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*Note: the resid.y is an internal variable in PROC MODEL defined as:&lt;/P&gt;
&lt;P&gt;resid.y = pred.y - actual.y&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_049/etsug/etsug_model_sect239.htm" target="_blank"&gt;SAS Help Center: Equation Translations&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this means that resid.y in PROC MODEL is the negative of the residual usually defined in the literature(which is actual - predicted).&amp;nbsp; So the variance equation in the version 1 PROC MODEL code is defined as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if epsilon_t-1&amp;nbsp; &amp;lt; 0 , then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;h_t = arch0 + arch1*(epsilon_t-1)**2 + garch1*h_t-1 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if epsilon_t-1 &amp;gt;=0 then&lt;/P&gt;
&lt;P&gt;h_t = arch0 + arch1*(epsilon_t-1)**2 + garch1*h_t-1 + phi*(epsilon_t-1)**2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While in version 2 PROC AUTOREG code(after removing NLAG = 1 option from your code), the GJR-GARCH model specifies the variance equation as discussed in the following section:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_049/etsug/etsug_autoreg_details12.htm#etsug_autoreg005090" target="_blank"&gt;SAS Help Center: GARCH Models&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;h_t = omega + (alpha1 + I_{epsilon_t-1 &amp;lt; 0}*psi1)*(epsilon_t-1)**2 + gamma1*h_t-1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;where I_{epsilon_t-1&amp;lt;0} is the indicator that takes the value 1 when epsilon_t-1 &amp;lt;0, and takes the value of 0 when epsilon_t-1 &amp;gt; = 0. The above variance equation is thus translated as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if epsilon_t-1 &amp;lt; 0, then&lt;/P&gt;
&lt;P&gt;h_t = omega + (alpha1 + psi1)*(epsilon_t-1)**2 + gamm1*h_t-1 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if epsilon_t-1 &amp;gt;=0 then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;h_t = omega + alpha1*(epsilon_t-1)**2 + gamma1*h_t-1 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Corresponding to the parameter names in PROC AUTOREG parameter estimates table,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;omega = TARCHA0&lt;/P&gt;
&lt;P&gt;alpha1 = TARCHA1&lt;/P&gt;
&lt;P&gt;psi1&amp;nbsp; &amp;nbsp; &amp;nbsp;= TARCHB1&amp;nbsp;&lt;/P&gt;
&lt;P&gt;gamma1 = TGARCH1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comparing the variance equations in the two versions, they are equivalent with the following reparameterization:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Version 1&amp;nbsp; PROC MODEL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Version 2 PROC AUTOREG(after removing NLAG = option)&lt;/P&gt;
&lt;P&gt;arch0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TARCHA0&lt;/P&gt;
&lt;P&gt;arch1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TARCHA1 + TARCHB1&lt;/P&gt;
&lt;P&gt;arch1 + phi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TARCHA1&lt;/P&gt;
&lt;P&gt;garch1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TGARCH1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From row 2 and row 3 above, you can see that phi and TARCHB1 is negative of each other:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;phi = -TARCHB1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;******************************************************&lt;/P&gt;
&lt;P&gt;Or alternatively, you may simply modify your version 1 PROC MODEL code by reversing the variance equations between the cases zlag(resid.y) &amp;gt;0 and&amp;nbsp; zlag(resid.y)&amp;lt;=0, i.e., specify the following variance equations instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;      /* variance model */
      if zlag(resid.y) &amp;lt;= 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;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then the two versions will have one on one matching on all the parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 16:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/923841#M4809</guid>
      <dc:creator>SASCom1</dc:creator>
      <dc:date>2024-04-10T16:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to read the result of GRJ-GARCH model?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/923902#M4810</link>
      <description>&lt;P&gt;hi, Wen, thanks for your detailed replies.&amp;nbsp; Following your advise, I have change into the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/* Verion 1 */
proc model data = oneCoin ;
   parms arch0 .1 arch1 .2 garch1 .75 phi .1;
   /* mean model */
   ret = intercept ;
   /* variance model */
   if zlag(resid.ret) &amp;lt;= 0 then
      h.ret = arch0 + arch1*xlag(resid.ret**2,mse.ret) + garch1*xlag(h.ret,mse.ret)  ;
   else
      h.ret = arch0 + arch1*xlag(resid.ret**2,mse.ret) + garch1*xlag(h.ret,mse.ret) +
            phi*xlag(resid.ret**2,mse.ret) ;
   /* fit the model */
   fit ret / method = marquardt fiml ;
run ;
quit ;

/* Verion 2 */
proc autoreg data=oneCoin ;
   model ret =    / garch=(p=1, q=1, type=gjrgarch) ; 
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output are not identical, but I guess they are close enough. Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gigiwen_0-1712804616792.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95445i2B7EA366E80E5437/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gigiwen_0-1712804616792.png" alt="Gigiwen_0-1712804616792.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 03:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/How-to-read-the-result-of-GRJ-GARCH-model/m-p/923902#M4810</guid>
      <dc:creator>Gigiwen</dc:creator>
      <dc:date>2024-04-11T03:05:10Z</dc:date>
    </item>
  </channel>
</rss>

