Page 1 of 1
Tsay(1998) TVAR Model

Posted:
Tue Mar 12, 2013 3:10 am
by Trankied
Dear Tom,
I have performed the process you provided for Tsay(1998) "Testing and Modeling Multivariate Threshold Models" examples,
http://www.estima.com/forum/viewtopic.php?f=8&t=1004However, I cannot get the same result as the paper done at "U.S. Interest Rates" example and how to estimate the threshold value by minimize AIC by process? just like Table 8 in Tsay(1998) paper.
Table8:

- Code: Select all
@gridseries(from=-.30,to=.05,n=80,pts=ngrid) rgrid
*
compute bestaic=%na
do i=1,ngrid-19
do j=i+20,ngrid
sweep(group=(thresh<rgrid(i))+(thresh<rgrid(j)),var=homo)
# g3year g3month
# constant g3year{1 to p} g3month{1 to p}
compute thisaic=-2.0*%logl+2.0*%nregsystem
if .not.%valid(bestaic).or.thisaic<bestaic
compute bestaic=thisaic,bestlower=rgrid(i),bestupper=rgrid(j)
end do j
end do i
*
I don't know exactly why set i=1,ngrid-19 and j=i+20
how to determine 19,20 and what's it means?
thanks for helping
Re: Tsay(1998) TVAR Model

Posted:
Tue Mar 12, 2013 7:31 am
by TomDoan
this is in the comments at the top of the program:
* U.S. Interest Rates example. Data are similar, but not identical to
* those used in the paper. However, the calculations in the paper had a
* serious programming error with the log likelihoods being computed
* incorrectly. (I'm fairly sure that instead of using - T/2 log |Sigma|,
* they used - T/2 log |T Sigma|).
*
* There is, in fact, very little support for a two break model over a
* one break.
*
Re: Tsay(1998) TVAR Model

Posted:
Tue Mar 12, 2013 11:12 pm
by Trankied
thanks for answer
BTW,the code above
- Code: Select all
do i=1,ngrid-19
do j=i+20,ngrid
I would like to know why set i=1,ngrid-19 and j=i+20,ngrid.
Could you please interpret what they means?
thans for answering
Re: Tsay(1998) TVAR Model

Posted:
Wed Mar 13, 2013 7:40 am
by TomDoan
If you're doing a grid search for two breaks, the second break point has to come after the first. You also want to make sure that the two have a gap between them.
do i=1,ngrid-19
do j=i+20,ngrid
has I as the subscript for the first break point and J as the second. In order to allow for 20 grid points between them, I can't go beyond ngrid-19, and J has to start at I+20.
Re: Tsay(1998) TVAR Model

Posted:
Fri Mar 15, 2013 12:32 am
by Trankied
I am appreciate your great help. It's very useful for me.
I have another question:
If I wanna estimate two threshold value for three-regime model, first threshold value get by [-0.3,-0.2],the other by [-0.15,0.05]
How should I code on this example?
Re: Tsay(1998) TVAR Model

Posted:
Fri Mar 15, 2013 6:55 am
by TomDoan
Trankied wrote:I am appreciate your great help. It's very useful for me.
I have another question:
If I wanna estimate two threshold value for three-regime model, first threshold value get by [-0.3,-0.2],the other by [-0.15,0.05]
How should I code on this example?
The overall lower and upper bounds are already -.3 and +.05 (note the @GridSeries). If you want to put hard restrictions on the two ranges, you just have to figure out the upper bound for I, and the lower bound for J that correspond to grid values of -.2 and -.15 respectively.
Re: Tsay(1998) TVAR Model

Posted:
Fri Mar 15, 2013 8:44 am
by Trankied
- Code: Select all
@gridseries(from=-.30,to=.05,n=80,pts=ngrid) rgrid
Could you explain the meaning of pts,ngrid and rgrid.
I cannot find them on user guide even on website.
thanks a lot
Re: Tsay(1998) TVAR Model

Posted:
Fri Mar 15, 2013 10:23 am
by TomDoan
When you're using a procedure, the best source for information about the parameters is generally the procedure file (gridseries.src) itself.
* Parameters:
* grid (output) series to be created
*
* Options:
* FROM=lower limit
* TO =upper limit
* SIZE=size of intervals
* N =number of intervals [100]
*
* At least two from FROM, TO and SIZE are needed to determine the grid
*
* PTS =(output) number of grid points
PTS in this case isn't really necessary since the N option is being used, so it just is set to the 80 that was requested using N. However, by doing the rest of the programming (for the example as written) using NGRID, the 80 can be changed (to a finer or a looser grid) without affecting the program below it.
Re: Tsay(1998) TVAR Model

Posted:
Sat Mar 16, 2013 7:36 am
by Trankied
so if I wanna choose lower break by 15%~40% and upper break by 57%~85%,
If there are 100 data available, could I set i=15,40 j=57,85 and n=100 ?
instead of estimating two break separately, I wanna estimate them at the same time and use AIC to determine it.
How should I code it?
Re: Tsay(1998) TVAR Model

Posted:
Sun Mar 17, 2013 7:22 am
by Trankied
another question:
if I would like to set threshold is delayed X.
I should
- Code: Select all
set thresh =X{1}
or
- Code: Select all
set thresh = X{-1}
Re: Tsay(1998) TVAR Model

Posted:
Mon Mar 18, 2013 11:08 am
by TomDoan
Trankied wrote:so if I wanna choose lower break by 15%~40% and upper break by 57%~85%,
If there are 100 data available, could I set i=15,40 j=57,85 and n=100 ?
instead of estimating two break separately, I wanna estimate them at the same time and use AIC to determine it.
How should I code it?
The FROM and TO limits on the @GRIDSERIES are already set to exclude the most extreme values since you need a certain amount of data just to estimate the models. I'm not completely sure what you mean by the percentages, but the Tsay coding is using an equally-spaced grid, rather than a grid based upon empirical values. The principal reason for that is that the number of potential regressions for an empirical grid was too large to be feasible at the time the paper was written.
Re: Tsay(1998) TVAR Model

Posted:
Mon Mar 18, 2013 11:09 am
by TomDoan
Trankied wrote:another question:
if I would like to set threshold is delayed X.
I should
- Code: Select all
set thresh =X{1}
or
- Code: Select all
set thresh = X{-1}
RATS uses x{n} for lag n, so you want x{1}. x{-1} would be for lead 1.