MSSysRegression

Discussion of models with structural breaks or endogenous switching.

MSSysRegression

Postby samson » Sun May 27, 2012 9:33 am

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
samson
 
Posts: 11
Joined: Fri Apr 20, 2012 3:53 am

Re: MSSysRegression

Postby TomDoan » Thu May 31, 2012 5:04 pm

Actually @MSSysRegression is for a systems regression with more than one dependent variable. Instead, you want @MSRegression http://www.estima.com/forum/viewtopic.php?f=7&t=1208.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: MSSysRegression

Postby samson » Fri Jun 01, 2012 10:03 pm

Dear Tom,

Thank you for your kind reply

I will give it a try~~


Best regards
Samson
samson
 
Posts: 11
Joined: Fri Apr 20, 2012 3:53 am

Re: MSSysRegression

Postby samson » Sun Jul 01, 2012 10:19 am

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
samson
 
Posts: 11
Joined: Fri Apr 20, 2012 3:53 am

Re: MSSysRegression

Postby TomDoan » Sun Jul 01, 2012 11:27 am

Add an

@MSFilterInit

before the MAXIMIZE. It makes sure everything is set up properly.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: MSSysRegression

Postby samson » Sun Jul 01, 2012 8:00 pm

It works!!

Thank you for your kind and instant reply :D

Best regards,
Samson
samson
 
Posts: 11
Joined: Fri Apr 20, 2012 3:53 am


Return to Structural Breaks and Switching Models

Who is online

Users browsing this forum: No registered users and 0 guests