<?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 Dynamic Factor Model for the Yield Curve with exogenous variable in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878099#M4666</link>
    <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;first of all thank you in advance for the helpfulness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to add an exogenous variable to the proc ssm in the code in example 33.7: Dynamic Factor Model for the Yield Curve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;proc ssm data=Dns optimizer(technique=dbldog maxiter=400);
       id date interval=month;

      /* Time-varying parameter lambda */
      parms v1-v7;
      lambda = exp(v1*c1 + v2*c2 + v3*c3 + v4*c4
           + v5*c5 + v6*c6 + v7*c7);

      /* Observation equation disturbance -- separate variance for each maturity */
      parms sigma1-sigma17 / lower=1.e-4;
      array s_array(17) sigma1-sigma17;
       do i=1 to 17;
          if (mtype=i) then sigma = s_array[i];
       end;
       if (mtype=18) then sigma = (sigma10+sigma11)/2;
       irregular wn variance=sigma;

       /* Variables Z1, Z2, Z3 needed in the observation equation */
       Z1= 1.0;
       tmp = lambda*maturity;
       Z2 = (1-exp(-tmp))/tmp;
       Z3 = ( 1-exp(-tmp)-tmp*exp(-tmp) )/tmp;

        /* Zero-mean VAR(1) factor zeta and the associated component */
       state zeta(3) type=VARMA(p(d)=1) cov(g) print=(cov ar);
       comp zetaComp = (Z1-Z3)*zeta;

       /* Constant mean vector mu and the associated component */
        state mu(3) type=rw;
        comp muComp = (Z1-Z3)*mu;

        /* Observation equation */
        model yield = muComp zetaComp wn;

        /* Various components defined only for output purposes  */
        eval yieldSurface = muComp + zetaComp;

        comp zeta1 = zeta[1];
        comp zeta2 = zeta[2];
        comp zeta3 = zeta[3];
        comp mu1 = mu[1];
        comp mu2 = mu[2];
        comp mu3 = mu[3];

        comp z2zeta = (Z2)*zeta[2];
        comp z3zeta = (Z3)*zeta[3];
        comp z2Mu =  (Z2)*mu[2];
        comp z3Mu =  (Z3)*mu[3];

        eval beta1 = mu1 + zeta1;
        eval beta2 = mu2 + zeta2;
        eval beta3 = mu3 + zeta3;

        eval shortTem = z2zeta + z2Mu;
        eval medTerm = z3zeta + z3Mu;

        /* output the component estimates and the forecasts */
        output out=dnsFor pdv;
    run;&lt;/PRE&gt;&lt;P&gt;I would like to add a exogenous variable to the VARMA model, so to affect all the betas (level, slope and curvature), like in a VARMAX model.&amp;nbsp; I'm not trying only to add in the observation equation the exogenous variable, i want that the known exogenous variable affect the variable called in the example (z1-z3).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2023 20:31:20 GMT</pubDate>
    <dc:creator>Nico98</dc:creator>
    <dc:date>2023-05-29T20:31:20Z</dc:date>
    <item>
      <title>Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878099#M4666</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;first of all thank you in advance for the helpfulness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to add an exogenous variable to the proc ssm in the code in example 33.7: Dynamic Factor Model for the Yield Curve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;proc ssm data=Dns optimizer(technique=dbldog maxiter=400);
       id date interval=month;

      /* Time-varying parameter lambda */
      parms v1-v7;
      lambda = exp(v1*c1 + v2*c2 + v3*c3 + v4*c4
           + v5*c5 + v6*c6 + v7*c7);

      /* Observation equation disturbance -- separate variance for each maturity */
      parms sigma1-sigma17 / lower=1.e-4;
      array s_array(17) sigma1-sigma17;
       do i=1 to 17;
          if (mtype=i) then sigma = s_array[i];
       end;
       if (mtype=18) then sigma = (sigma10+sigma11)/2;
       irregular wn variance=sigma;

       /* Variables Z1, Z2, Z3 needed in the observation equation */
       Z1= 1.0;
       tmp = lambda*maturity;
       Z2 = (1-exp(-tmp))/tmp;
       Z3 = ( 1-exp(-tmp)-tmp*exp(-tmp) )/tmp;

        /* Zero-mean VAR(1) factor zeta and the associated component */
       state zeta(3) type=VARMA(p(d)=1) cov(g) print=(cov ar);
       comp zetaComp = (Z1-Z3)*zeta;

       /* Constant mean vector mu and the associated component */
        state mu(3) type=rw;
        comp muComp = (Z1-Z3)*mu;

        /* Observation equation */
        model yield = muComp zetaComp wn;

        /* Various components defined only for output purposes  */
        eval yieldSurface = muComp + zetaComp;

        comp zeta1 = zeta[1];
        comp zeta2 = zeta[2];
        comp zeta3 = zeta[3];
        comp mu1 = mu[1];
        comp mu2 = mu[2];
        comp mu3 = mu[3];

        comp z2zeta = (Z2)*zeta[2];
        comp z3zeta = (Z3)*zeta[3];
        comp z2Mu =  (Z2)*mu[2];
        comp z3Mu =  (Z3)*mu[3];

        eval beta1 = mu1 + zeta1;
        eval beta2 = mu2 + zeta2;
        eval beta3 = mu3 + zeta3;

        eval shortTem = z2zeta + z2Mu;
        eval medTerm = z3zeta + z3Mu;

        /* output the component estimates and the forecasts */
        output out=dnsFor pdv;
    run;&lt;/PRE&gt;&lt;P&gt;I would like to add a exogenous variable to the VARMA model, so to affect all the betas (level, slope and curvature), like in a VARMAX model.&amp;nbsp; I'm not trying only to add in the observation equation the exogenous variable, i want that the known exogenous variable affect the variable called in the example (z1-z3).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 20:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878099#M4666</guid>
      <dc:creator>Nico98</dc:creator>
      <dc:date>2023-05-29T20:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878246#M4667</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43004"&gt;@rselukar&lt;/a&gt;&amp;nbsp;can answer this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 15:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878246#M4667</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-05-30T15:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878248#M4668</link>
      <description>&lt;P&gt;Hello Nico98,&lt;/P&gt;
&lt;P&gt;The VARMA type in the STATE statement of PROC SSM has relatively limited functionality.&amp;nbsp;If you describe your model in more detail (all the variables in your data set, precise formulation of your SSM with these variables in mind, etc), I can try to provide the PROC SSM syntax for your model.&amp;nbsp; &amp;nbsp;If you also provide some test data to along with this model, that will be even better.&amp;nbsp;&amp;nbsp;Any reference article that explains/illustrates this model?&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 15:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878248#M4668</guid>
      <dc:creator>rselukar</dc:creator>
      <dc:date>2023-05-30T15:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878249#M4669</link>
      <description>Hello,&lt;BR /&gt;thank you again for your help.&lt;BR /&gt;So i'm tring to model some interbanks interest rates, for example the EURIRS interest rate from 1 to 30 years. Instead of just model these yield using the Dynamic Factor Model without explanatory variable I would like to use the main refinancing rate (REFI) as exogenous variable to the VARMA part of the state space. But until now i cannot use that as explanatory variable for that specific part.&lt;BR /&gt;So from the example i would like to only add the effecting on an exogenous variable (REFI) on the Z1-Z2 and Z3 (so the level, slope and curvature).</description>
      <pubDate>Tue, 30 May 2023 16:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878249#M4669</guid>
      <dc:creator>Nico98</dc:creator>
      <dc:date>2023-05-30T16:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878250#M4670</link>
      <description>&lt;P&gt;Tell me more precisely the mathematical equations that involve your variable REFI.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 16:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878250#M4670</guid>
      <dc:creator>rselukar</dc:creator>
      <dc:date>2023-05-30T16:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878257#M4671</link>
      <description>&lt;P class=""&gt;The beta of the models are 3: beta1-beta2-beta3. With the formula in the example that is: beta1(t)=mu+zeta(t).&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I want something like: beta1(t)=zu+zeta(t)+REFI(t). Where REFI is the exogenous known variable estimated outside and that give the scenario of my analysis.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 16:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878257#M4671</guid>
      <dc:creator>Nico98</dc:creator>
      <dc:date>2023-05-30T16:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878260#M4672</link>
      <description>&lt;P&gt;Instead of having only the VARMA and rw process, i want also to affect the parameter (Z1-Z3) with the exogenous variable refi.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.jpg" style="width: 828px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84489i1ABF780DD8AA6E17/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;From this state space you have to imagine to have also &lt;STRONG&gt;Z*REFI(t)&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 17:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878260#M4672</guid>
      <dc:creator>Nico98</dc:creator>
      <dc:date>2023-05-30T17:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878283#M4673</link>
      <description>&lt;P&gt;If I understand your model, you could try the following:&lt;/P&gt;
&lt;P&gt;create a zero-variable:&lt;/P&gt;
&lt;P&gt;zero = 0;&lt;/P&gt;
&lt;P&gt;Then modify the specification of mu and the related component as follows:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;state &lt;/SPAN&gt;&lt;SPAN class="token function keyword"&gt;mu&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;sinput=(refi zero zero) type&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;rw&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;&lt;SPAN&gt;comp muComp &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; (&lt;SPAN&gt;Z1&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Z3&lt;/SPAN&gt;)&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;mu&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 17:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878283#M4673</guid>
      <dc:creator>rselukar</dc:creator>
      <dc:date>2023-05-30T17:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Factor Model for the Yield Curve with exogenous variable</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878300#M4674</link>
      <description>&lt;P&gt;Given the documentation and what i tried to do I think you are correct, so i thank you a lot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the results are quite poor, so i think that just for now i will continue to use proc varmax for the betas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using proc ssm the path of the betas are not so much defined by the exogenous variable and are quite unreasonable.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 19:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Dynamic-Factor-Model-for-the-Yield-Curve-with-exogenous-variable/m-p/878300#M4674</guid>
      <dc:creator>Nico98</dc:creator>
      <dc:date>2023-05-30T19:56:24Z</dc:date>
    </item>
  </channel>
</rss>

