Thanks, that worked perfectly. However, it brought another issue to my attention that I'm not sure how to solve.
For this Markov Switching model, I'm using LEI to predict whether or not the economy is in a recession, using the binary indicator provided by the NBER as a point of reference. Following the example I linked to, I ended up using the binary recession indicator to construct 'd'. But this is obviously an issue since my goal is to predict the state variable endogenously, rather than figure out the parameters in different states.If I am using the NBER indicator in my markov chain, which is the thing I'm trying to predict, then I'm not actually doing anything.
Would you know how I could set up this model in SAS to predict the state variable, ONLY using %change in the LEI (without referencing the NBER indicator?).
For reference, here is my code (mostly taken wholesale from the example):
proc model data=revisedLEI_and_nber;
parms sig1=10 sig2=10 int1 int2;
bounds 0.0001 < sig1 sig2;
a = NBER_binary;
d = probnorm(a);
y1=int1;
y2=int2;
rtchglei = (1 - d)*y1 + d*y2;
logL = ((1/2)*( (log(2*3.1415)) +
log( (sig1**2)*((1-d)**2)+(sig2**2)*(d**2) )
+ (resid.rtchglei*( 1/( (sig1**2)*((1-d)**2)+(sig2**2)*(d**2) ) )*resid.rtchglei) ) );
errormodel rtchglei ~ general(logL);
fit rtchglei / method=marquardt converge=1.0e-5 out=o;
outvar d;
run;