MSSysRegression

Discussion of models with structural breaks or endogenous switching.
samson
Posts: 10
Joined: Fri Apr 20, 2012 3:53 am

MSSysRegression

Unread post by samson »

Hello,

I am trying to fit a fixed-tansition-probability Markov-switching model with one exogenous variable:

Y_t = b0_st + b1_st * X_t + epsilon_t , and st is either 1 or 0 .

I think that the procedure MSSysRegression.src is what I need, but some errors occur when I apply this procedure.

(In fact, I just modified some code from msvarsetup.src to use @MSSysRegression.)

Code: Select all

@MSSysRegression(states =2,switch=CH)
# Y
# X
frml MSSysRegf = log(%MSSysRegProb(t))
nonlin(parmset=msparms) p
nonlin(parmset=varparms) mu betasys sigmav
@MSSysReginit
maximize(parmset=varparms+msparms, $
start= (pstar=%MSSysRegInit()), $
reject = %MSSysRegInitTransition()==0.0, $
method=bfgs, iters=300) MSSysRegf
In short, my questions are:

1.
When I applied the code above, I got the message like:

## SX11. Identifier %MSSYSREGPROB is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>> log(%MSSysRegProb(<<<<

and

## CP18. MSSYSREGINIT is not the Name of a PROCEDURE. (Did you forget to SOURCE?)
>>>>@MSSysReginit<<<<

How to modifiy the code in order to fit the FTP-MS model with one exogenous variable?

2.
Is that possible to fit the model with @msvarsetup?


I would really appreciate your help~~

Regards,
Samson
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: MSSysRegression

Unread post by TomDoan »

Actually @MSSysRegression is for a systems regression with more than one dependent variable. Instead, you want @MSRegression.
samson
Posts: 10
Joined: Fri Apr 20, 2012 3:53 am

Re: MSSysRegression

Unread post by samson »

Dear Tom:

I try to estimate the MS model with the @msregression procedure.

Here is the code:

Code: Select all

@MSRegression(states=2, switch = ch) r
# constant shock
frml logl = f=%MSRegFVec(t),fpt=%MSProb(t,f),log(fpt)
nonlin(parmset=msparms) p
nonlin(parmset=regparms) betas sigsqv
@MSRegInitial gstart gend
maximize(parmset=regparms+msparms,$
  start=%(pstar=%MSInit()),$
  method=bfgs,iters=300) logl gstart gend
But error occurs when i run this procedure.

Code: Select all

## MAT15. Subscripts Too Large or Non-Positive
The Error Occurred At Location 196, Line 19 of %MSPROB
What does that mean?


Best regards,
Samson
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: MSSysRegression

Unread post by TomDoan »

Add an

@MSFilterInit

before the MAXIMIZE. It makes sure everything is set up properly.
samson
Posts: 10
Joined: Fri Apr 20, 2012 3:53 am

Re: MSSysRegression

Unread post by samson »

It works!!

Thank you for your kind and instant reply :D

Best regards,
Samson
Post Reply