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; comp zeta2 = zeta; comp zeta3 = zeta; comp mu1 = mu; comp mu2 = mu; comp mu3 = mu; comp z2zeta = (Z2)*zeta; comp z3zeta = (Z3)*zeta; comp z2Mu = (Z2)*mu; comp z3Mu = (Z3)*mu; 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
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?
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.
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.
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.