DATA Step, Macro, Functions and more

proc ssm question

Reply
Frequent Contributor
Frequent Contributor
Posts: 79

proc ssm question

 

Please can someone explain what exactly is going on here. I have read the user guide, but i dont understand what is going on

I get the beta2 to beta 6, but i am not sure I understand what is lv1- lv8 and avar, wnv1 etc and tvar

Any help is greatly appreciated

 

Thanks so much!

qf

 

 

 ods output NamedParameterEstimates = named;
 proc ssm data=econ opt(tech=activeset);
   id date interval=day;
   parms beta2-beta6;
   parms lv1-lv8;
   avar = exp(lv7);
   wnv1 = exp(lv1);  wnv2 = exp(lv2);
   wnv3 = exp(lv3);  wnv4 = exp(lv4);
   wnv5 = exp(lv5);  wnv6 = exp(lv6);
   tvar = exp(lv8);
   zero = 0;

    /* --- start of model spec ----*/
   state latent(2) t(g)=(1 1 0 1) cov(d)=(zero avar);
   comp c1 = latent[1];
   comp c2 = (beta2)*latent[1];
   comp c3 = (beta3)*latent[1];
   comp c4 = (beta4)*latent[1];
   comp c5 = (beta5)*latent[1];
   comp c6 = (beta6)*latent[1];

   irregular w1 variance=wnv1;
   int1 = 1;
   model ld_payemp = int1 c1 w1;

   irregular w2 variance=wnv2;
   int2 = 1;
   model ld_pinc = int2 c2 w2;

   irregular w3 variance=wnv3;
   int3 = 1;
   model ld_mnfctr = int3 c3 w3;

   irregular w4 variance=wnv4;
   int4 = 1;
   model ld_indpro = int4 c4 w4;

   irregular w5 variance=wnv5;
   int5 = 1;
   model ld_gdp = int5 c5 w5;

   irregular w6 variance=wnv6 ;
   trend t_icsa(ll) levelvar=0 slopevar=tvar;
   model l_icsa = c6 t_icsa w6;
   /* ---model spec done----*/

   eval icsaPattern = c6 + t_icsa;
   /*--index is a scaled version of the common factor--*/
   eval Index = 1000*c1;
   comp slope = latent[2];
   eval IndexSlope = 1000*slope;
   /*--just so recession is output to the output data set--*/
   rec = recession;
   output out=forecast1 press pdv;
  run;

 

 

Ask a Question
Discussion stats
  • 0 replies
  • 181 views
  • 0 likes
  • 1 in conversation