summarize BETAS coefficients in MS model
summarize BETAS coefficients in MS model
Dear Tom,
Could you tell me how to summarize BETAS coefficients for a MS Linear Regression?
Could you tell me how to summarize BETAS coefficients for a MS Linear Regression?
Re: summarize BETAS coefficients in MS model
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)
summarize(parmset=varparms+msparms) PHI(1)(1,1)+PHI(2)(1,1)+PHI(3)(1,1)+PHI(4)(1,1)
Re: summarize BETAS coefficients in MS model
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
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
Re: summarize BETAS coefficients in MS model
summarize(parmset=regparms+msparms) ...
should work fine.
should work fine.
Re: summarize BETAS coefficients in MS model
Unfortunately, I got that error again
Re: summarize BETAS coefficients in MS model
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)
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
Re: summarize BETAS coefficients in MS model
That's right, I exit RATS and re-open it again then it worked!. I dont know what happened.
Re: summarize BETAS coefficients in MS model
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.