TSM Basics (from the User's Manual)

TIME SERIES MODELLING Version 4 is an interactive package for modelling and forecasting time series. It is designed primarily for nonlinear dynamic model estimation, including ARMA and ARFIMA models, conditional variance models (ARCH/GARCH and several variants), regime-switching and smooth transition. It also functions well as a user-friendly, general purpose regression package.

To enhance its power and ease of use, the program has various special features not found in comparable packages. It is strongly recommended to read through this introduction before starting work with TSM. It does not aim to describe all the capabilities of the package. These can best be discovered by browsing the menus in conjunction with the Help pages provided for each. Its purpose is to outline TSM's unique design and operating conventions to first-time users.  

 

****************

Working with TSM

****************

1. ENTERING DATA

Regression packages often have their own proprietary database formats, and getting data into them from different sources can be troublesome. By contrast, TSM reads either ASCII files or spreadsheet files directly. It works smoothly in conjunction with popular spreadsheet programs such as Microsoft Excel, Lotus 123 and OxMetrics, for preliminary data organization, and for further analysis and graphing of outputs. It can itself merge datasets with different start and finish dates and use and display date information, including daily dates in Excel format. It offers flexible single-observation editing, series transformations, and dummy creation capabilities.   

 

2. MENUS AND DIALOGS.

TSM is operated in Graphical User Interface (GUI) mode by setting the options in a number of dialogs. These can be opened from the menu bar or by shortcut buttons on the tool bar. Some operations can be performed in several different ways. For example, an estimation run can be launched from the menus, from the "Running Man" toolbar button, and also from the "Go" buttons in several dialogs. The action of the toolbar button can vary depending on the dialog currently open.  

 

3. COMPUTING ESTIMATES, TESTS AND FORECASTS

The basic method of operation is as follows:

1)        Specify the calculations and settings desired, using the Setup, Model, Values and Options menus.

2)        Launch the estimation module using one of the commands on the Actions menu, a dialog button, or a tool bar button.

 

Both the "Running Man" and the "Calculator" buttons on the tool bar launch closed form (non-iterative) estimations, such as OLS and IV, and associated tests and forecasts. For nonlinear estimation (if enabled) the "Running Man" button launches the optimization algorithm, while the "Calculator" button just performs post- estimation computations (forecasts or tests) using the currently stored parameter values, either obtained on the latest run or entered by the user.  

NOTE: forecasts and tests are not computed by merely specifying them in the Options dialog! Use the menu items in the Actions menu for this purpose. The "Calculator" button performs all currently specified calculations and generates the complete estimation output for the current parameter values.  Each run has a unique ID number to identify the outputs associated with it, such as graphics files, spreadsheet files, and settings files.

 

4. SAVING PROGRAM SETTINGS
TSM has a large number of optional settings that most users will want to change only occasionally. By default, the program automatically saves all current settings in a special file called (by default) "settings.tsm". The current data set, listings and charts are stored (by default) in “settings.tsd”. When the program is restarted the working environment, with all selected options, is then exactly as it was in the last session, even if the original data files have been moved or deleted in the meantime. Named settings files (with .tsm and .tsd extensions and 'red TSM' and 'blue TSD' Windows icons) can be saved and re-loaded manually at any time.

 

5. ORGANIZING YOUR WORK

The File / Settings / Export... command saves a complete image of the current session, including options, model specifications, data, generated series, tables and graphics. 'Exported' .tsm files do not contain local path information and are fully portable between installations. When they are opened, the data file and temporary storage (.tsd) files are recreated. This provides an ideal way to share work with collaborators, move between home/office installations and distribute classroom exercises. Double-clicking on a .tsm file icon in Windows Explorer starts the program and loads the file contents automatically.  

 

6. SIMULATION

Part of the TSM philosophy is that any model that can be estimated by the program can also be simulated, using randomly generated disturbances or bootstrapped (randomly resampled) residuals. The former can be Gaussian, or generated from the distribution specified by the selected likelihood function. This feature can be used for one-off simulations whose output is graphed. Comparing the simulation of the fitted model with the original data can be a useful informal diagnostic tool. However, the main application for the simulation module is to running bootstrap tests and Monte Carlo experiments. A flexible interactive Monte Carlo module is provided.  

 

7. MODELS

A "model" is a complete set of specifications and values to estimate, simulate or forecast an equation or system of equations. Any number of these specifications can be stored and recalled during a session, as well as saved permanently in the settings (.tsm) file. For example, this option allows the user to run an exploratory regression on the fly, while working on a complex multiple-equation model, without losing any settings and values. Just use the Model Manager to store the current settings and values to a named model (optionally including the data set). Load the model to restore them again. The generated series, graphics and (optionally) data set associated with a model are stored in a file with '.tsd' extension and 'blue TSM' Windows icon

Models are also used for running Monte Carlo experiments. Select one model to generate the data using the simulation module, and another (or the same) model for estimating, allowing a very flexible approach to misspecification analysis.   

 

8. PROGRAMMING WITH TSM

TSM can be called as a module in your own Ox program. It is easy to write out the commands and options set by TSM dialogs as lines of Ox code. Your program can call the main program functions such as "Run_Estimation" and "Run_Simulation", and perform further operations on the output.  The special scripting language is fully detailed in the programming manual. To see what your current set of (non-default) options looks like in coded form, give the command File / Settings / Display/Save Text... and inspect the listing created. The reverse operation is also possible. Write out a set of coded commands in the TSM launch file, and these options are then set when the GUI program is started. This provides an alternative way to set and maintain your list of favourite program options.

 

*****************

Modelling with TSM

*****************

9. TYPES OF MODEL

There are two main model specification dialogs, called respectively Linear Regression and Dynamic Equation. The "Regression Scatter" and "Space Shuttle" toolbar buttons give direct access to these. (The latter can be optionally hidden to simply the interface, if these features are not being used.) Linear Regression is used to specify linear models for estimation by a closed- form expression (or, at most, a fixed, finite sequence of calculations). These include OLS, 2SLS, SUR and 3SLS. Although linear regressions can also be specified in the Dynamic Equation dialog, its special role is to set up nonlinear dynamic models. All estimation in this dialog, even of linear models, is done by optimizing a log-likelihood or other criterion function numerically, using the BFGS and/or simulated annealing algorithms. Model choices include Gaussian, Student t and GED continuous distributions, binary logit and probit models, and count data models. All these models can feature conditional variances, and Markov switching or smooth transition nonlinearity.    

 

10. SELECTING VARIABLES

Model specification dialogs include a list of variable names, corresponding to the currently loaded data file. Selecting a variable is a two-step procedure. First select a radio button specifying the variable Type - dependent variable(s), one of several types of explanatory variables, instruments, and so forth. Next, click on the desired name in the list, to highlight it. The list can be scrolled, if it is too long to display complete in the dialog. Note that when one or more variables are selected in a category, the corresponding radio button is highlighted with a lighter-grey panel. To see which variables are currently selected in a particular category, click on the radio button in question. A little practice helps to get variable selection smooth and rapid, and it is a good idea to click on each highlighted button in turn to check the specification is as desired, before launching the estimation run. To deselect a variable, simply click on it again to remove the highlight. There is also a "Clear" button to remove all the current selections.

NOTE: to display time plots of one or more variables, highlight them in the list and click the 'Data Graphics' button on the toolbar

 

11. VARIABLE "TYPES"

Explanatory variables in an equation can be of two, or three, different "Types", with a different radio button assigned to each. In some models "typing" is irrelevant (in which case, just choose Type 1), but it has a number of common uses. In linear regressions, it is used to allow lags to be treated differently. Lags up to a specified order can be included automatically, so that lagged values do not need to be created and stored individually in the database. The number of lags is selected with the scroll bar, for all variables of the given Type. For example, assign non-lagged variables such as dummies to Type 1, and distributed lag regressors to Type 2. To allow easy inclusion of the lagged dependent variable, the dependent variable in a regression can be assigned as a Type 2 regressor with lags specified. The current value is omitted from the regressor set automatically. This also works in system models such as VARs.

In the Dynamic Equation dialog, "typing" regressors in combination with specifying autoregressive and moving average components has a special additional role, allowing an equation to feature "structural dynamics" and/or "error dynamics". See the relevant Help pages and the TSM main document, for details on this.

 

12. PARAMETER VALUES

A special feature of TSM is the Values dialogs, where values and conditions for model parameters can be set. Among the uses of these dialogs are

·                  Setting starting values for numerical optimization

·                  Fixing parameters at chosen values during estimation

·                  Setting inequality constraints on parameters during estimation

·                  Setting zero or linear restrictions on parameters, either for constrained estimation, or calculation of Wald tests.  

The Values dialogs can be accessed from the menu bar, or by the "Values" button in the relevant model specification dialog.

 

Parameter values obtained in the latest estimation run can be viewed in the Values dialogs, and will form the starting values for the next run unless edited or cleared. Alternatively, the menu item Evaluate at Current Values (or the "Calculator" button) generates the program outputs at these values, without re-optimizing.

 

13. CODED FUNCTIONS

General nonlinear models can be estimated by creating coded formulae. The program features a formula parser which can evaluate functions of data and/or parameters typed using standard notations. This feature is used to create functions for estimation and parameter restrictions for testing, as well as data transformations.  Alternatively, TSM can estimate a model programmed by the user in the Ox language, while making use of all the estimation, testing and forecasting features of the package. (This feature is distinct from, though compatible with, calling TSM from within an Ox program.)

 

14. SYSTEMS OF EQUATIONS

Setting up a system of equations is greatly simplified by requiring that the right- hand side of every equation has the same specification. In this way, only one specification has to be created and stored. This is the natural approach for an unrestricted VAR, for example. To have the equations different from each other (e.g. with identifying restrictions imposed) the method is to create an inclusive specification of which all the actual equations are special cases, and then "fix" the surplus parameters at zero in the Values dialogs - enter 0 in the value fields, and check the 'Fixed' checkboxes. While editing values, one can switch easily from one equation to another with the 'Equation' buttons. Parameters fixed at 0 are not reported in the output, although those fixed at non-zero values are listed as such.

Systems of coded nonlinear functions can be estimated in the same way. While their specifications can differ, each has the common set of named parameters assigned to it - "fix" the surplus ones in Values / Equation, so that the search algorithm ignores them.

Simultaneous equation systems can be specified by including variables as both dependent variables and Type 1 regressors. When their presence in both sets is detected by the program, the system is estimated by FIML. It is the user's responsibility to ensure that identifying restrictions are imposed on the equations, in this case.   

In vector ARMA and GARCH models specified in the Dynamic Equation dialog, the lags of all the variables are included by default in each equation. For example, a VAR(2) system of three equations has 6 regressors in each equation. Of course, some of these regressors can be suppressed if desired, by fixing their coefficients at 0 in the Values dialogs.

Note that a VAR can be set up in either the Linear Regression dialog or the Dynamic Equation dialog. In the first case it will be estimated in two steps, by SUR (equivalently OLS, if unrestricted). In the second case it will be estimated numerically, by Least Generalized Variance or ML.  

 

15. OUTPUT CONVENTIONS

The outputs from TSM are not always the same as those of other packages. t-ratios and p-values are not reported in those cases where "zero" is not the natural null hypothesis for the parameter (variances for example). The Durbin Watson statistic is not reported by default, since it is often not valid in dynamic regressions. See the Tests and Diagnostics Options dialog to select it. A valid LM statistic or M-statistic for residual autocorrelation, or neglected ARCH, can always be computed if desired, and provides an equivalent test to the DW in those cases where it is valid. Autocorrelation Q statistics for residuals and squared residuals are reported by default, as are standard model selection criteria, although these outputs can be optionally suppressed.

Robust standard errors are reported by default. These will not match the "naive" (conventional) standard error formulae reported by most packages, and note that the latter are often based on incorrect assumptions, although they can always be computed as an option. Heteroscedasticity and autocorrelation consistent (HAC) standard errors are also optionally available. Test p-values and confidence intervals can also be computed by the parametric bootstrap, based on resampling model residuals and using the fitted model to simulate data under the null hypothesis.   

Asymptotic chi-squared statistics are reported by default for the standard tests of restrictions and mis-specification, although reporting in 'F-statistic' form is a selectable option. (Note that in most time series applications, 'F statistics' are not truly F distributed in finite samples.) Bootstrap p-values can be computed if desired, for improved test performance in small samples. Another approach related to the bootstrap is to tabulate test statistics by simulation and use the EDF tabulations to generate p-values.   

 

How To ...

For the first-time user who doesn't want to spend too much time with the user's manual, here are some simple step-by-step instructions to get you started.

 

1. HOW TO LOAD A DATA SET

·                  EITHER: click the "Open File" button on the tool bar. In the file dialog, navigate to the Windows folder containing your data file and click on it.
OR: simply drag the data file icon from the Windows Explorer window and drop it onto the TSM window.

·                  Several different file formats are supported, but an Excel worksheet is a popular choice. The series should be stored in columns, starting in column 2, with the first row of the spreadsheet containing the variable names.

 

2. HOW TO PLOT DATA SERIES

·                  Click with the mouse on the variable list in any open dialog.

·                  Click the "Chart" button on the toolbar, to display plots of all the highlighted series on the list.

·                  Clicking the "Chart" button without first clicking a variable list opens the Graphics / Show Data Graphic dialog.

 

3. HOW TO RUN A SIMPLE REGRESSION.

·                  Click on the "regression scatter" button to open the Linear Regression dialog.

·                  In the Select Estimator box choose Ordinary Least Squares (the default).

·                  Choose the dependent variable from the list, and highlight the name by clicking on it with the mouse. At most one name can be selected at once. Note that the radio button is highlighted to show you have made a selection

·                  In the "Select Regressors" panel, click on the "Type 1" radio button. Then select the regressors from the list, as for the dependent variable. Any number of names can be selected. The radio button is highlighted.

·                  Click the check-box for Intercept, and, if appropriate, for Trend.

·                  To ensure your selection of variables is as you intend, it's a good idea the click alternately on the highlighted radio buttons. Note how your selections on the data list are highlighted in turn.

·                  Click the "Go" button in the dialog - or the "Running Man" or "Calculator" buttons on the tool bar. All have the same action, in this case.

·                  The results appear in the window. To view the Actual-Fitted and Residual plots, click the "Twin-Graph" button on the tool bar.

·                  To use less than the complete sample for estimation, click the "Select Sample" button to open the sample-setting dialog. Use the scroll bars to select the first and last observation.

·                  When you launch an estimation run, open dialogs are closed automatically to show the results window. Click the "Windows" button on the tool bar to restore them to their previous locations on the screen.

 

4. HOW TO GENERATE QUARTERLY DUMMIES

·                  Click the "f(X)" button on the tool bar.

·                  Click the Edit button, then scroll down the choice widget until you find "Make Seasonals".

·                  A scroll bar to choose the frequency appears. Select "4", and press Go.

·                  Four dummy variables are added to the data set. Add only three of themto your regression if you have an intercept!

 

5. HOW TO TAKE LOGARITHMS OF YOUR DATA

·                  Click the "f(X)" button on the tool bar.

·                  Click the Transform button, then scroll down the choice widget until you find "Logarithm".

·                  Highlight all the variables on the list you wish to transform.

·                  Click Go. The transformed variables are added to the data set, identified with the prefix "Log-" added to the name.

·                  To give a more convenient name, if desired, select Edit and Rename with the choice widget, and enter the new name in the field provided.

 

6. HOW TO TEST THE SIGNIFICANCE OF THE REGRESSION

·                  The following procedure provides a valid time series implementation of the "F test of the Regression" reported routinely by many packages. It tests all exogenous regressors, but automatically excludes the trend, seasonal dummies, and lagged dependent variables from the test set. Thus, the null hypothesis can be a valid univariate representation of the dependent variable.

·                  In the Linear Regression dialog, check "Wald Test of Constraints".

·                  Use the button beside the checkbox to open the Constraints dialog, and check the box "Test Joint Significance of Regressors".

·                  The test is computed by running the regression, or by choosing Actions / Compute Test Statistics / Wald Test of Set Restrictions.

 

7. HOW TO TEST FOR A UNIT ROOT

·                  Open the Setup / Compute Summary Statistics dialog.

·                  Choose the variable you want to test and press Go.

·                  The Augmented Dickey-Fuller test and Phillips-Perron statistics are among the results reported. The order of lags in the ADF test is chosen automatically to optimize the Schwarz model selection criterion over the range up to M = O(T^1/3). The bandwidth settings for the Phillips-Perron test can be changed in Options / General...

 

8. HOW TO ESTIMATE AN ARMA(p,q) MODEL

·                  Click the "Space Shuttle" button on the tool bar to open the Dynamic Equation dialog. (If this is not shown, open Options / General, check" Enable Optimization Estimators", and restart TSM.)

·                  In the Select Estimator box, choose Least Squares.

·                  Select your dependent variable from the list.

·                  Use the scroll bars to select the desired AR and MA orders (p and q).

·                  Select a Type 2 intercept (this is identified even if you have a unit root). You cannot have both types at once, so deselect the Type 1 intercept first, if necessary.

·                  Press "Go", or the "Running Man" button.

·                  If your run has been successful, you should see "Strong Convergence" in the results window.

·                  If you aren't sure what p and q to choose, you can have the program try each pair in succession up to a chosen maximum. Click Setup / Multiple ARMA Models... and select the maximum values you want to try. Click the Running Man with this dialog open, and see the estimates computed successively in the results window.

·                  You can choose a preferred specification by comparing the Akaike, Schwarz or Hannan-Quinn selection criteria for each model.

·                  To estimate an ARIMA(p,1,q) model check the "Impose Unit Root" box.

 

9. HOW TO FORECAST WITH AN ARMA/ARIMA MODEL

·                  Having selected your model, choose Options / Forecasting..., and use the scroll bar to select the number of post-sample periods to forecast. Note that you cannot forecast beyond the end of the data set if your model contains exogenous variables.

·                  Select the options "Ex-ante Multi-Step" and "Analytic".

·                  Now open the Options / Output and Retrieval dialog, and in the panel Print in Results Window, check the option "Forecasts & MA Coeffs".

·                  If the model has already been estimated, click the "Calculator" button on the tool bar. This will evaluate the model and forecasts. Otherwise, click "Running Man" to run the estimation and forecast calculation in one step.

·                  To see the point forecasts and confidence intervals graphically, select Graphics / Ex-Ante Forecasts.  

·                  The forecasts can also be exported to a spreadsheet file. Click File /Listings / Save Forecasts.  

 

10. HOW TO ESTIMATE A SIMPLE VAR MODEL

·                  Open the Linear Regression dialog and check the box "System of          Equations". You are now allowed to select two or more dependent variables.

·                  In the Select Regressors panel, click on the Type 2 radio button. Make the      *same* selections as you made for the dependent variables. Use the Lags scroll bar to choose the VAR order.

·                  Select an intercept, if desired. Any exogenous variables can be added to the model as regressors of Type 1.

·                  Press "Go", or the "Running Man" or "Calculator" buttons to estimate the model.

·                  Note that when endogenous variables are entered as Type 2 Regressors, the current values are automatically suppressed, making it easy to specify lagged dependent variables.

·                  A VAR or VARMA can also be estimated in the Dynamic Equation dialog.

 

11. HOW TO ESTIMATE A GARCH MODEL

·                  Open the Dynamic Equations dialog.

·                  Specify the 'mean equation' as appropriate. This could be an ARMA, or a regression model, for example.

·                  In the Select Estimator panel, choose Gaussian ML.

·                  Click on Conditional Variance Model. The Conditional Variance dialog box opens.

·                  Select the GAR and GMA orders.

·                  To see the model in the form usually reported (the 'Bollerslev form') open the Options / ML and Dynamics dialog box and, under "GARCH Settings", uncheck the first two checkboxes. (Note, the model you fit is identical in either case. Only the interpretation of the coefficients is affected by these options.)

·                  Press the Go or Running Man buttons to estimate.

·                  Estimation of GARCH models can sometimes be tricky. Poor starting values can cause convergence failure. See Help / Hints and Tips for advice on optimization in case of difficulty.