Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- Dynamic Factor Model for the Yield Curve with exogenous variable

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-29-2023 04:31 PM
(311 views)

Hello everyone,

first of all thank you in advance for the helpfulness.

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.

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;

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. 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).

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If I understand your model, you could try the following:

create a zero-variable:

zero = 0;

Then modify the specification of mu and the related component as follows:

state mu(3) sinput=(refi zero zero) type=rw;

comp muComp = (Z1-Z3)*mu;

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello Nico98,

The VARMA type in the STATE statement of PROC SSM has relatively limited functionality. 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. If you also provide some test data to along with this model, that will be even better. Any reference article that explains/illustrates this model?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

thank you again for your help.

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.

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).

thank you again for your help.

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.

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).

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Tell me more precisely the mathematical equations that involve your variable REFI.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The beta of the models are 3: beta1-beta2-beta3. With the formula in the example that is: beta1(t)=mu+zeta(t).

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Instead of having only the VARMA and rw process, i want also to affect the parameter (Z1-Z3) with the exogenous variable refi.

From this state space you have to imagine to have also **Z*REFI(t)**.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If I understand your model, you could try the following:

create a zero-variable:

zero = 0;

Then modify the specification of mu and the related component as follows:

state mu(3) sinput=(refi zero zero) type=rw;

comp muComp = (Z1-Z3)*mu;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Given the documentation and what i tried to do I think you are correct, so i thank you a lot.

However, the results are quite poor, so i think that just for now i will continue to use proc varmax for the betas.

Using proc ssm the path of the betas are not so much defined by the exogenous variable and are quite unreasonable.

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.