Based on Professor Timo Teräsvirta's GAUSS code Ivar Pettersen has written a class of procedures, called STR2 which estimate and test STAR-models.
We recommend Teräsvirta's paper on STR-estimation ("Handbook of applied economic statistics", volume 155, edited by Ullah and Giles, 1998 by Marcel Dekker, Inc) as a starting point. In that paper, a UK House data file is used, which has been kindly made available to us by David Hendry. It is installed with STR2 in the form of ukhouse4.in7/ukhouse4.bn7.
Please note that this program is very much in its Beta-stage, and we accept no responsiblity for any estimation errors or other problems. Some of the text in the program is in Norwegian, this will be translate eventually. No support is given for this program. The appropriate forum to discuss problems is the ox-users discussion list.
Next, install STR2 within OxPack (this requires Ox Professional)
Start OxMetrics,
enter the Run-menu, select OxPack. The oxpack box
includes a menu called Package. From this menu, select the item called
Add/Remove Package. The following dialog box should
appear:
The upper field should contain the (absolute) address of the STR2 oxo-file: use the Browse button to find this. The lower field should hold the name of the class, in this case STR2. Remember that the field is case-sensitive. Press Add and the STR2 package should be available.
See ukhouse1.ox for an example of an Ox program that uses the STR2 package.
The InitX procedures calculate starting values. I originally had one Init procedure that handled all types of STR-models. I chose to divide this to avoid confusion and to gain some speed.
The STR-estimation uses not only the estimated starting values for gamma and c but also the parameter estimates. The program ought to have an option to set the parameter starting values to zero. And the possibility of user-provided starting values should be implemented.
Timo Teräsvirta's procedures are at the end of the program. They are direct translations from the GAUSS files. But I have changed them to work with zero indexing.
The Gradient procedure is fishy. The formulas are Timo Teräsvirtas concerning LSTR1 with one or two transition variables but the ESTR- and LSTR2- calculations are incorrect. I have not given enough attention to this given that I never use ESTR. Comments appriciated. The errors will not affect estimation results, but will make several tests inapplicable.
The program is tested against results from Teräsvirta's estimation of Hendry's housing model. Several model formulations have not been validated (ESTR, LSTR2 and models where a variable is modelled with two transition-variables). The estimates of these routines provide may be wrong. (Better: assume them to be wrong.)
In the variable selection dialog (choose Model -> Formulate) there are 8 types of variables when right-clicking on a variable(s) in the selection:
If the user chooses a model with one transition variable (LSTR1) the Transvar2 and Nlin_variable2 have other purposes. If using LSTR1 all variables marked with Transvar2 will be tested as potential transition variables (given that linearity tests are selected in the options box, this applies to both pre-estimation tests for non-linearity and post-estimation tests for remaining non-linearity). The Nlin_variable2 box is used to select variables to be tested for constancy. It can be used to pick variables entering the linear part only. Variables entering the non-linear part are selected in the options menu (I ran out of buttons so some ad hoc solutions are used).
The program can only handle one or two transition variables. The non-linear variables may be modelled with either one of the transition variables, or both at the same time.
Figure 1: The variable selection dialog box.
The screen capture shows all the options described above. To replicate the results, formulate the model as shown. Notice that all variables which play a role in the estimation are labelled with a letter. The example is typical for an estimation of a model with one transition variable, delph_1. The Constant and mphh1are modelled both linearly and non-linearly, and are labeled N. The variables labeled L are modelled linearly only.
Figure 2: Model settings
The model setting box selects which tests to perform, sets parameters for starting values grid search and chooses among output options. The entries are:
Press OK after making your selections in the model settings dialog takes you to the Estimate Model-box, as seen below:
Figure 3: Estimate Model
This is where one can choose the preferred method and select the sample. LSTR1_2 is the option for two transition variables. Make your selections and the estimations start. The options button lets the user choose convergence criteria for the iteration procedure.
Estimation output is:
STR2 package version 0.84 beta, object created on 13-03-2006
ukhouse4.in7 loaded from D:\OxMetrics4\Ox\packages\STR2\ukhouse4.in7
Cstep: 0.00391612
Best g, c and ssr
3.0000 0.086171 0.011502
Number positive:37
Sample: 1959(1) - 1982(2)
Frequency: 4
Transition variable: dlph_1
Number of observations is 94
Variable name, coeff estimate, std deviation, and t-value
Constant 0.404 0.1023 3.948
mphh1 0.1292 0.02537 5.093
a2dly 0.4944 0.1091 4.531
f13dlp 0.7176 0.1234 5.817
f13lmp 0.4442 0.1069 4.156
dvbanks -2.189 0.5344 -4.096
d674 -3.636 1.265 -2.875
Q1 0.0009773 0.004815 0.203
Q2 0.02355 0.004169 5.649
Q3 0.01706 0.003947 4.322
lyh1 0.3469 0.06287 5.518
dr1to1 -0.5019 0.2211 -2.27
r1toa1_3 -0.2108 0.08869 -2.377
dlph_2 0.2207 0.07756 2.845
Non-linear parameters: dlph_1
Constant 2.755 0.68 4.052
mphh1 0.5534 0.1396 3.965
The search for starting values took 0.766 seconds :
Returncode from MaxBFGS: 0
Strong convergence
Returncode from Num2Derivative: 1
Sample: 1959(1) - 1982(2)
Frequency: 4
Transition variable: dlph_1
Number of observations is 94
Variable name, coeff estimate, std deviation, and t-value
GAMMA 2.484 1.69 1.47
C1 0.0872 0.009004 9.685
Constant 0.378 0.1209 3.127
mphh1 0.1231 0.02985 4.122
a2dly 0.4759 0.1187 4.008
f13dlp 0.6996 0.1328 5.269
f13lmp 0.4354 0.1104 3.942
dvbanks -2.137 0.5425 -3.94
d674 -3.61 1.28 -2.82
Q1 0.001117 0.004895 0.2282
Q2 0.02358 0.004222 5.585
Q3 0.01743 0.00408 4.271
lyh1 0.3409 0.06626 5.146
dr1to1 -0.5135 0.2273 -2.259
r1toa1_3 -0.208 0.09007 -2.309
dlph_2 0.2171 0.07927 2.738
Non-linear parameters: dlph_1
Constant 2.932 1.333 2.199
mphh1 0.5889 0.271 2.173
Initial func value
0.011502
SSR/function value 0.0114488
Inv std of tr var
35.517
SSR/number of obs. 0.000121796
AIC -8.63019
SBIC -8.14317
1000*Residual variance 0.150642
R-squared
0.84739
Std error of residuals 0.0122736
|
Figure 4: Estimated transition function and residuals
A variable selection box for estimating a model with two transition variables is shown below. The difference from above is that Q2 and Q3 are modelled non-linearly with trend as the second transition variable.
Figure 5: The variable selection dialog box.