Case Studies

The Time Series Lab (TSL) software packages make time series analysis available to anyone with a basic knowledge of statistics. The program is written in such a way that results can be obtained quickly. However, many advanced options are available for the time series experts among us. The modelling process in TSL consists of a five step procedure: Database, Model setup, Estimation, Graphics & diagnostics, and Forecasting. In our case studies, we often present screenshots of the program so that you can easily replicate results.

Did you know you can make a screenshot of a TSL program window? Press Ctrl + p to open a window which allows you to save a screenshot of the program. The TSL window should be located on your main monitor.

Click on the buttons below to go to our case studies. At the beginning of each case study, the required TSL package is mentioned. Our first case study, about the Nile data, is meant to illustrate the basic workings of the program.

Minks

Rutger Lit
July 5, 2021
TSL module: State Space Edition - Univariate Basic
Topics: cyclical patterns in data

In this case study we illustrate how to model the presence of a cycle using the numbers of furs of minks and muskrats traded annually by the Hudson Bay Company in Canada from 1848 to 1909. The main issue concerns the existence of a cycle in the pattern of traded furs of both minks and muskrats. Parts of this case study are from the STAMP manual.

The MINKMUSK dataset is part of the TSL installer and can be found in the data folder located in the install folder of TSL - State Space Edition. It is instructive to carry out a preliminary analysis on the data. Go to the Database section and load the data in TSL and plot it by clicking the Lmink (L for logarithm) header in the database section. Click the autocorrelation function button in the bottom right of the screen. The autocorrelation function shows evidence of a cycle buried within the noise. The spectral density shows the same message. On this graph, the period is given by dividing 2 by the scaled frequency, on the horizontal axis. Thus there appears to be a cycle with a period of around 10 years.

Proceed to Model setup and select a Fixed Level, a Stochastic Slope and a Cycle component.

Estimation section ► Estimation ends at t = 1909 ► Estimate

Once the estimation has been finished we are automatically brought to the Graphics and diagnostics section.

Graphics and diagnosticsClear all ► select the Individual tab ► plot Y data and Level
Add subplot
plot Y data ► select the Composite tab and plot Composite signal
Add subplot
select the Individual tab and plot Cycle
Add subplot
select the Residuals tab, select Smoothing, and plot Residuals

mink signal
Plot 1: mink data and level. Plot 2: mink data and composite signal. Plot 3: extracted cycle. Plot 4: residuals.

It can be seen in the Figure above that the estimated trends are relatively smooth. The smoothness arises because the level variances were constrained to be zero and the q-ratios for the slope are small. More precise information about the fitted cycle can be found in the written output on the Text output page.

The written output shows us (among other things) the Cycle properties:

Parameter type Cycle 1  
Variance 0.0642  
Period 9.6477  
Frequency 0.6513  
Damping factor 1.0000  
Amplitude 0.3550  

The parameters are as follows:
  • A variance parameter which is responsible for making the cycle stochastic
  • A period (in years), $\lambda $
  • A frequency (in radians) $2 \pi / \lambda$
  • A damping factor $\rho $
The cycle has a period parameter of 9.65 years. The relative importance of the cycle is indicated by the Amplitude. For data in logarithms, the amplitude of the cycle is a percentage of the trend. This is for Lmink 35.5%.

Now let's turn our attention to the Lmuskrat series. Repeat all steps as described above but now for the Lmuskrat series. We obtain the following cycle properties:

Parameter type Cycle 1  
Variance 0.0786  
Period 9.7439  
Frequency 0.6448  
Damping factor 0.9994  
Amplitude 0.4059  

Let's investigate the cycles of Lmink and Lmuskrat by plotting the cycles in one graph. For this we explore the Add plots to database functionality on the Graphics and diagnostics page. This functionality can be switched on and off with the switch in the top middle of the Graphics and diagnostics page. When switched on (this is the default), every component that is or was plotted is stored in the Database on the Database page.

Go to the Database page and click on Lmink Cycle (Smo) followed by Ctrl-click Lmuskrat Cycle (Smo). Both cycles are now plotted in one graph and from this you can see that the cycle extracted from the Lmuskrat series leads the cycle of Lmink by three years.

mink signal
Extracted cycles of Lmink and Lmuskrat.
Further exploration:
  • [Not statistics] Why would the cycle of Lmuskrat lead the cycle of Lmink by three years?
  • The multivariate module of TSL - State Space Edition enables us to model both the Lmink and Lmuskrat series simultaneously, see also the example in STAMP

Bibliography

References

Koopman, S.J., A.C. Harvey, J.A. Doornik, and N. Shephard (2012). STAMP: Structural time series analyser, modeller and predictor. London, Timberlake Consultants Ltd.