summarize BETAS coefficients in MS model

Discussion of models with structural breaks or endogenous switching.
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

summarize BETAS coefficients in MS model

Unread post by abi »

Dear Tom,

Could you tell me how to summarize BETAS coefficients for a MS Linear Regression?
TomDoan
Posts: 7779
Joined: Wed Nov 01, 2006 4:36 pm

Re: summarize BETAS coefficients in MS model

Unread post by TomDoan »

Summarize as in compute linear combinations of? You can do that with SUMMARIZE. For instance, the following computes the sum of the "PHI" (lag coefficients) in the HAMILTON.RPF example.

summarize(parmset=varparms+msparms) PHI(1)(1,1)+PHI(2)(1,1)+PHI(3)(1,1)+PHI(4)(1,1)
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: summarize BETAS coefficients in MS model

Unread post by abi »

Thank you Tom,

Actually after running FRUEHP366B.RPF when i want to compute the sum of BETAS coefficients, the following error occurred.

## NL9. PARMSET is Size 24. Doesn't Match Last Estimation of Size 14
TomDoan
Posts: 7779
Joined: Wed Nov 01, 2006 4:36 pm

Re: summarize BETAS coefficients in MS model

Unread post by TomDoan »

summarize(parmset=regparms+msparms) ...

should work fine.
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: summarize BETAS coefficients in MS model

Unread post by abi »

Unfortunately, I got that error again
TomDoan
Posts: 7779
Joined: Wed Nov 01, 2006 4:36 pm

Re: summarize BETAS coefficients in MS model

Unread post by TomDoan »

Code: Select all

*
* FRUEHP366B.RPF
* Fruehwirth-Schnatter, "Finite Mixture and Markov Switching Models"
* GDP example from pp 366-370. Totally switching models.
*
open data gnp.dat
calendar(q) 1951:2
data(format=free,skip=1,org=columns) 1951:02 1984:04 gnp gnplag ggrowth
*
linreg(define=fulleqn) ggrowth
# constant ggrowth{1 to 4}
*
@msregression(regimes=2,equation=fulleqn,switch=ch) ggrowth
frml logl = f=%MSRegFVec(t),fpt=%MSProb(t,f),log(fpt)
*
* Common estimation range
*
compute gstart=1952:2,gend=1984:4
*
@nbercycles(down=recession)
linreg(smpl=recession,equation=fulleqn)
compute betas(1)=tr(%beta),sigsqv(1)=%seesq
linreg(smpl=.not.recession,equation=fulleqn)
compute betas(2)=tr(%beta),sigsqv(2)=%seesq
compute theta=||1.0,-2.0||
*
@MSRegParmset(parmset=regparms)
nonlin(parmset=msparms) theta
*
compute p=%MSLogisticP(theta)
@MSFilterInit
maximize(parmset=regparms+msparms,$
  start=%(p=%MSLogisticP(theta),pstar=%MSInit()),$
  pmethod=simplex,piters=5,method=bfgs,iters=300) logl gstart gend
@MSRegStdResiduals ustd gstart gend
@regcorrs(number=5,qstat) ustd
graph
# ustd
summarize(parmset=regparms+msparms)  BETAS(1)(2)+BETAS(1)(3)+BETAS(1)(4)+BETAS(1)(5)
summarize(parmset=regparms+msparms)  BETAS(2)(2)+BETAS(2)(3)+BETAS(2)(4)+BETAS(2)(5)
gives (for the two SUMMARIZE instructions)

Code: Select all

Summary of Function of Coefficients

Value           0.73151395          t-Statistic            3.45458
Standard Error  0.21175173          Signif Level         0.0005511


Summary of Function of Coefficients

Value           0.14731592          t-Statistic            0.65331
Standard Error  0.22549266          Signif Level         0.5135584

abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: summarize BETAS coefficients in MS model

Unread post by abi »

That's right, I exit RATS and re-open it again then it worked!. I dont know what happened.
TomDoan
Posts: 7779
Joined: Wed Nov 01, 2006 4:36 pm

Re: summarize BETAS coefficients in MS model

Unread post by TomDoan »

The File-Clear Memory operation should be enough rather than closing and restarting. That wipes out any of the remnants of the old statistical calculations.
Post Reply