Case Studies

If you're interested in time series analysis and forecasting, this is the right place to be. The Time Series Lab (TSL) software platform makes time series analysis available to anyone with a basic knowledge of statistics. Future versions will remove the need for a basic knowledge altogether by providing fully automated forecasting systems. The platform is designed and developed in a way such that results can be obtained quickly and verified easily. At the same time, many advanced time series and forecasting operations are available for the experts. 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 and we advise you to start with that one.

Stochastic Volatility

Author: Rutger Lit
Date: June 30, 2022
Software: Time Series Lab - Home Edition
Topics: variable transformation, autoregressive process
Batch program: stochastic_volatility.txt

Stochastic Volatility

Let $y_t$ be a stock series returns or the difference of logged exchange rates. Such a series will normally be approximately white noise. However it may not be independent because of serial dependence in the variance. This can be modelled by \begin{equation}\label{sv1} y_t = \sigma_t \epsilon_t = \sigma \epsilon_t \text{exp}(h_t/2), \quad \epsilon_t\sim \text{IID}(0, 1), \quad t = 1,\ldots,T \end{equation} where \begin{equation}\label{sv2} h_{t+1} = \phi h_t + \eta_t, \quad \eta_t \sim \text{NID}(0,\sigma^2_{\eta}), \quad |\phi| \leq 1. \end{equation} The term $\sigma^2$ is a scale factor, $\phi$ is a persistence parameter, and $\eta_t$ is a disturbance term which in the simplest model is uncorrelated with $\epsilon_t$. Literature reviews are given by Shephard (2005) and Ghysels, Harvey, and Renault (1996). This stochastic volatility (SV) model has two main attractions. The first is that it is the natural (Euler) discrete time analogue of the continuous time model used in papers on option pricing, such as Hull and White (1987). The second is that its statistical properties are easy to determine. The disadvantage with respect to the conditional variance models of the GARCH class is that likelihood based estimation can only be carried out by a computer intensive technique such as that described in Kim, Shephard, and Chib (1998) and Sandmann and Koopman (1998). However, a quasi-maximum likelihood (QML) method is relatively easy to apply and is often reasonably efficient. This method is based on transforming the observations to give: \begin{equation}\label{sv3} \text{log}\, y^2_t = \kappa + h_t + \xi_t, \quad t = 1,\ldots,T \end{equation} where \begin{equation} \xi_t = \text{log}\, \epsilon^2_t - E(\text{log}\, \epsilon^2_t) \end{equation} and \begin{equation} \kappa = \text{log}\, \sigma^2 + E(\text{log}\, \epsilon^2_t) \end{equation} As shown in Harvey, Ruiz, and Shephard (1994), the state space form given by equations \eqref{sv1} and \eqref{sv2} provides the basis for QML estimation via the Kalman filter and also enables smoothed estimates of the variance component, $h_t$, to be constructed and predictions made. One of the attractions of the QML approach is that it can be applied without the assumption of a particular distribution for $\epsilon_t$. In Harvey, Ruiz, and Shephard (1994), the volatility in the daily exchange rate of the US dollar against four currencies is examined; see also Mahieu and Schotman (1998).

Daily exchange rates

The data are in the file EXCH.csv which is part of any TSL installer file with a version number higher than v1.00 and can be found in the data folder located in the install folder of TSL. The file EXCH.csv consists of daily exchange rates for the US dollar. The four series are the daily exchange rates of the dollar against the pound, deutschmark, yen and Swiss franc. The data were recorded at the end of each weekday from 1/10/81 until 28/6/85. Thus the sample size is 946.

Step 1 is to load the time series data and transform it so that we can model the data as in equation \eqref{sv3}.

Database ► Load database ► Load the EXCH.csv file.

In the figure below, the EXCH dataset is loaded into TSL and the Pound / Dollar exchange rate is highlighted.

Pound / USD exchange rate

Data inspection and preparation page
Time Series Lab Database page. The Pound / USD exchange rate is highlighted.

Our next task is to obtain returns from the exchange rates. We do this by taking first differences of the logarithm of the exchange rates.

Highlight the Pound series ► Select Percentage change from the Data transformation pull-down menu ► Click on the Apply transformation button.

A new variable should appear in the Database section with the name Pound_pc. This new variable corresponds with the $y_t$ variable in equation \eqref{sv3}. Next we need to square the series and finally take logs to equal the left hand side of equation \eqref{sv3}.

Highlight the Pound_pc series ► Select Square from the Data transformation pull-down menu ► Click on the Apply transformation button. ► Select Logs from the Data transformation pull-down menu ► Click on the Apply transformation button.
We should now see the following figure:

Transformed Pound / USD exchange rate

Data inspection and preparation page
Time Series Lab Database page. The transformed Pound / USD exchange rate series is highlighted.

Subsequently go to the Build your own model page and select an ARMA(1,0) and a Fixed Level. Go to
Model setup page ► Select a fixed Level (no slope) ► select an ARMA process of order p=1 and q=0.
Go to Estimate page ► Estimate.
We should now see the following figure. The smoothed estimate of the volatility process, $h_t$, is displayed in the usual way by selecting the ARMA(p,q) process on the Graphics and Diagnostics page.

Fixed Level and ARMA(1,0) process

Data inspection and preparation page
Time Series Lab graphics page with (fixed) Level and ARMA(1,0) process plotted.

If we select the Exponential option in the Signal transformation pull-down menu we can plot the exponent of the smoothed volatility. This may be interpreted as the ratio of the volatility to the underlying level.
It may be preferable to consider the variations in the standard deviation, $\text{exp}(h_t / 2)$, in which case we select the Exp(0.5 x) signal transformation. This is shown in the following figure.

Extracted Stochastic Volatility

Data inspection and preparation page
Estimated $\text{exp}(h_t)$ and $\text{exp}(h_t / 2)$ for the Pound series.

Bibliography

References

Shephard, N., 2005. Stochastic Volatility: Selected Readings. Oxford University Press, Oxford.

Ghysels, E., A. C. Harvey, and E. Renault (1996). Stochastic volatility. In C. R. Rao and G. S. Maddala (Eds.), Statistical Methods in Finance, pp. 119–91. Amsterdam: North-Holland.

Hull, J. and A. White (1987). The pricing of options on assets with stochastic volatilities. J. Finance 42, 281–300.

Kim, S., N. Shephard, and S. Chib (1998). Stochastic volatility: likelihood inference and comparison with ARCH models. Rev. Economic Studies 65, 361–93.

Sandmann, G. and S. J. Koopman (1998). Estimation of stochastic volatility models via Monte Carlo maximum likelihood. J. Econometrics 87, 271–301.

Harvey, A. C., E. Ruiz, and N. Shephard (1994). Multivariate stochastic variance models. Rev. Economic Studies 61, 247–64.

Mahieu, R. and P. Schotman (1998). An empirical application of stochastic volatility models. J. Applied Econometrics 16, 333–59.