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
... View more