fractional process, giving the long-memorySV model. For ﬁnancial time series, there is strong evidence that the effect of a shock tovolatility persists (i.e. is not absorbed) for a long number of periods (see e.g. Andersenand Bollerslev (1997), Lobato and Savin (1998), Harvey (1998), Bollerslev and Jubinski(1999), Bollerslev and Mikkelsen (1999), Bollerslev and Wright (2000) and Ray and Tsay(2000)), thus the concept of long memory seems suitable and has been suggested by Breidtet al. (1998). A covariance stationary time series yt has long memory if:∞
|Cov(yt , yt−r )| = ∞
r=0
with Var(yt ) < ∞. Basically, it says that the autocovariances do decay as the lag increasesbut very slowly, usually hyperbolically.Currently there exist four approaches to estimate the long-memory SV model. Thequasi-maximum likelihood estimator of Breidt et al. (1998), the GMM approach of Wright(1999), the widely used semiparametric, log-periodogram estimator of Geweke and PorterHudak (1983) (see e.g. Andersen and Bollerslev (1997), Ray and Tsay (2000), Wright(2000), Deo and Hurvich (2001) and the recent developments of Hurvich and Ray(2001), Hurvich et al. (2001)) and the Bayesian estimator based on the Markov ChainMonte Carlo sampler (Chan and Petris, 1999) and eventually the wavelet representationof the log-squared returns (Jensen, 1999, 2000, 2001).The quasi-MLE of the long-memory SV model is known to be strongly consistent,but requires the order of the short-memory autoregressive and moving average parameters to be correctly identiﬁed, as does the GMM estimator. The difference between the
Stochastic Volatility Models
263
quasi-MLE and GMM is that when the fractional order of integration is smaller than 1/4,the asymptotic properties in addition to consistency are known for the GMM estimator.Unlike the quasi-MLE of a short-memory stochastic volatility model whose asymptoticproperties are known (Harvey et al., 1994; Ruiz, 1994), these other asymptotic properties are not yet known for the quasi-MLE of the long-memory SV model. However, insimulation experiments, Wright (1999) ﬁnds that neither estimator’s ﬁnite-sample properties dominate the other; the GMM estimator of the long-memory parameter generallyproduces smaller standard errors but with a signiﬁcant downward bias. From these simulations Wright (1999) admonishes developing alternative estimators of the long-memorySV model that are more efﬁcient and less biased. In fact, even if Deo and Hurvich (2001)ﬁnd the asymptotic properties for the log-periodogram estimator of volatility to be similarto those proved by Robinson (1995) for the same estimator in the mean, correct inference about the degree of long-memory relies on the number of Fourier frequencies in theregression growing at a rate that is dependent on the value of the unknown long-memoryparameter. It thus seems that neither the quasi-MLE nor the log-periodogram estimator ofthe long-memory volatility model lend themselves nicely to the construction of conﬁdenceintervals or hypothesis testing of the long-memory parameter estimate.Finally, it could be useful to allow the SV model to capture the non-symmetric responseto shocks. This feature can be modelled by allowing εt−1 and ηt to be correlated. If εt−1and ηt are negatively correlated, and if εt−1 > 0, then yt−1 > 0 and ht is likely to fall.2Hence, a large effect of yt−1on the estimated ht will be accentuated by a negative sign onyt−1 , while its effect will be partially ameliorated by a positive sign. This correlation wassuggested by Hull and White (1987) and estimated using GMM by Melino and Turnbull(1990) and Scott (1991). A simple quasi-maximum likelihood estimator has been proposedby Harvey and Shephard (1996). Jacquier et al. (1995) have extended their single-moveMCMC sampler to estimate this effect.8.5.2 Extensions of discrete SV modelsIn the discrete case, the basic model might be extended by considering different Markovchains, which can allow the decomposition of shocks into permanent and transitory as inthe continuous case:yt = εt exp(zt ht /2)(8.10)ht = µ + TStwhere St represents a vector of Markov chains. However, the vector of Markov chainscan easily be represented by a single Markov chain with a sufﬁcient number of states andthen the model (8.10) formally reduces to the basic model (8.3).Finally, the two SV models can be combined by allowing the continuous latent volatility to be governed by a ﬁrst-order Markov chain. In that case, the estimation is verydifﬁcult. So et al. (1998) therefore propose Bayesian estimators which are constructed byGibbs sampling.
8.6 MULTIVARIATE MODELSMost macroeconomics and ﬁnance is about how variables interact, thus a multivariateapproach is very important. For multivariate stochastic volatility models this means that
264
Applied Quantitative Methods for Trading and Investment
it is essential to capture changing cross-covariance patterns. Multivariate modelling ofcovariance is rather new and difﬁcult because it is afﬂicted by extreme problems of lackof parsimony. From a modelling point of view, the multivariate SV models are easier toextend than the ARCH models, but the estimation problem remains.8.6.1 Multivariate continuous SV modelsSome multivariate continuous SV models are easy to state. Harvey et al. (1994) appliedquasi-likelihood Kalman ﬁltering techniques on:yit = εit exp(hit /2)
i = 1, . . . , M,

εt = (ε1t , . . . , εMt ) ∼ NIID(0, ε )
(8.11)

where ε is a correlation matrix and ht = (h1t , . . . , hMt ) a multivariate random walk,although more complicated linear dynamics could be handled. The approach again relieson linearising, this time with loss of information, by writing log yit2 = hit + log εit2 . Thevector of log εit2 is iid, all with means −1.27, and a covariance matrix which is a knownfunction of ε . Consequently, ε and the parameters indexing the dynamics of ht canbe estimated.It is worthwhile pointing out two aspects of this model. If rank constraints are imposedon ht , common trends and cycles will be allowed into the process describing the volatility.Furthermore, the model is similar to Bollerslev’s (1990) model which is characterised byconstant conditional correlation. Hence the model is better deﬁned as one of changingvariances rather than of changing correlation. Consequently, it fails to represent importantfeatures of the data and so it is of limited interest.Perhaps a more attractive multivariate SV model can be obtained by introducing factors.The simplest one-factor model is:yt = λft + wt , wt ∼ NIID(0, w )ft = εt exp(ht /2), ht = βht−1 + ηt , ηt ∼ NIID(0, ση2 )where yt is perturbed by wt and explained by the scaled univariate SV model ft . Typicallyw will be assumed diagonal, perhaps driven by independent SV models.The lack of an obvious linearising transformation for these models prevents us fromeffectively using Kalman ﬁltering methods. MCMC methods do not suffer this drawbackand are explored in Jacquier et al. (1995) and Pitt and Shephard (1999b).8.6.2 Multivariate discrete SV modelsThe multivariate extension of the discrete stochastic volatility model (8.3) is easy tostate. We can consider the multivariate framework (8.11) and allow each component ofht = (h1t , . . . , hMt ) to follow a two-state Markov chain, i.e.yit = εit exp(hit /2), i = 1, . . . , M, εt = (ε1t , . . . , εMt ) ∼ NIID(0, ε )hit = α + βsitIn order to apply the Hamilton ﬁlter and to obtain the likelihood function, it is useful todeﬁne a new Markov chain St with 2M states, which represents the M Markov chainsgoverning the dynamics of ht .
Stochastic Volatility Models
265
If the M Markov chains are independent, the transition probabilities of St are simplyobtained by multiplying the probabilities that drive the different Markov chains. Accordingly, the transition probability matrix will be Q = P1 ⊗ P2 ⊗ · · · ⊗ PM , where ⊗ indicates the Kronecker product and Pi the transition matrix of sit , i = 1, 2, . . . , M. In thatcase, the number of states rises exponentially with the dimension of ht , but the numberof parameters describing the Markov chains grows linearly with M and is 2M.A more general speciﬁcation does not make any a priori assumptions about the relationsbetween the different Markov chains. The transition probabilities of the composite Markovchain St are then given by:qij = (St = j |St−1 = i),
i, j = 1, 2, . . . , 2M
which requires 2M (2M − 1) parameters. To understand the dimension of the problem, withM = 2 (and two states), the independent case requires four parameters, while the generalspeciﬁcation requires 12 parameters.Clearly the general speciﬁcation becomes quickly unfeasible but, in some applications,the independent case is not useful to understand the causality between the volatilityof different assets. Billio (2002a) proposes considering several correlated cases with anumber of parameters comprised between 2M and 2M (2M − 1) by exploiting the conceptof Granger causality.As for the continuous SV model, a more interesting multivariate extension can beobtained by introducing a latent factor structure where the latent factors are characterisedby discrete stochastic volatility. Unfortunately, in that case the joint process of the observable variable yt and of the latent Markov chains is no longer Markovian, and then theHamilton ﬁlter no longer works. For the estimation it is thus necessary to use someapproximation or to use simulation-based methods (see Billio and Monfort (1998), Kimand Nelson (1999)).
8.7 EMPIRICAL APPLICATIONSTo provide simple illustrations of the usefulness of SV models, the two basic models areestimated and their output is used to develop standard option pricing and to calculate theVaR of an asset or a portfolio.
8.7.1 The Volatility programThere do not exist statistical packages to easily and directly estimate28 SV models andthus the necessary routines have been developed with Ox (version 3.20), a programming28Linear state space models can be estimated with the Kalman ﬁlter in EViews, with the Gauss packageFANPAC or the Ox package SSFPack (see also STAMP). Thus the linearised version (8.6) could be estimatedwith a quasi-maximum likelihood approach. For the switching regime models, see also MSVAR, an Ox packagedeveloped by H.M. Krolzig and designed for the econometric modelling of univariate and multiple time seriessubject to shifts in regime (http://www.economics.ox.ac.uk/research/hendry/krolzig/).
266
Applied Quantitative Methods for Trading and Investment
language created mainly by Jurgen A. Doornik.29 These routines can also be used withinthe package GiveWin.The ﬁles required for running the Volatility program30 are “volatilitymain.ox”, the mainprogram ﬁle, “volatility.oxo”, a compiled ﬁle containing the deﬁnition of the functions,and the header ﬁle “volatility.h”, containing the lists of global variables and functions.In Ox or GiveWin it is sufﬁcient to load the main program ﬁle, to select the appropriateoptions and then to run the program (for the details of the commands and options see theenclosed readme.txt ﬁle).Depending on which commands are commented out (// in front of the command) theprogram can:• Estimate a basic continuous or discrete SV model on a user provided series;• Simulate a basic continuous or discrete SV model;• Estimate a basic continuous or discrete model on a user provided series and thensimulate an alternative path with the estimated parameters.It shall be stressed that GiveWin is not needed to estimate the models but only to displaygraphs. This program can easily be used with the freeware version of Ox in conjunctionwith any text editor, however we recommend the use of OxEdit since it integrates withOx; both packages can be downloaded from Doornik’s website (see footnote 29). All thegraphic windows presented in this chapter are taken from GiveWin.The ﬁrst line of code in Figure 8.2, just before the “main” command, imports the“volatility.oxo” ﬁle, which contains the functions, recalls the Database class and other Oxpackages such as the graphic, the probabilistic and the maximisation ones.31The program is then organised as follows:• In a ﬁrst step the time series of interest is requested in an Excel spreadsheet. The userhas to indicate the exact path of the ﬁle to be loaded (other data formats can be used, seethe readme.txt ﬁle for additional details). Data passed to the programs must be the pricelevels, the necessary transformations are directly carried out by the estimation routines.• In a second step the model is chosen, estimated and, if desired, simulated.• Finally, the outputs of the model are printed and graphed to the screen and saved.29Ox is an object-oriented matrix programming language with a comprehensive mathematical and statisticalfunction library whose major features are speed, extensive library and well-designed syntax, leading to programswhich are easy to maintain. In particular, this program takes advantage of the concept of class: it is possibleto create new classes based on existing ones and to use their functions, therefore avoiding the need to rewritethem for the new class. In our case, the program is built on the Database class, which is the class designedfor handling databases, samples, names of variables, etc. The Database class is used as a starting point forthe more speciﬁc class of Stochastic Volatility Model: the functions, both to estimate and to simulate themodels and to store the results, are totally rewritten, while the functions that manage the time series are partof the Database class. More information on Ox can be found at http://www.nuff.ox.ac.uk/users/doornik/. Seealso Doornik (2001).30Updated versions of the program will be available for download at the address www.greta.it (under theWorking Papers section). The package is free of charge for academic and research purposes. For commercialuse, please contact the author (mgobbo@greta.it).31Of course, it is possible to modify the program by adding functions belonging to the loaded Database classor to other different classes. In this case, the class containing the desired functions must be loaded by addinga line of code (#import “. . .”) before the “main” command.
Stochastic Volatility Models
267
Figure 8.2 The main program “volatilitymain.ox” loaded with GiveWin with the full listof commands
The available variables in the Excel ﬁle “series.xls” are the daily stock indexes analysedin Section 8.1.1, i.e. the FTSE100, the CAC40 and the MIB30 indexes. In the exampledeveloped in this chapter attention will be focused on the modelling of the FTSE100 index.In the ﬁrst part of the program, these variables are loaded in Excel format. Thus the fullsample of FTSE100 is selected in order to start the analysis and perform the estimation.The command “Estimate” is quite complex and requires inputs by the user: the type ofmodel, the choice of the initialisation of the parameter values and their values if the userwants to deﬁne them (see Figure 8.3 and the readme.txt ﬁle).
8.7.1.1 EstimationThe package allows the analysis of the two basic models, i.e. the log-normal SV model(8.2), called ARSV in the program, which is estimated by quasi-maximum likelihoodwith the Kalman ﬁlter, and the two-regime switching model (8.3), called SRSV, whichis estimated by maximum likelihood with the Hamilton ﬁlter.The ﬁrst model is:yt = µ + εt exp(ht /2)ht = α + βht−1 + ηtwith εt and ηt independent Gaussian white noises. Their variances are 1 and ση2 , respectively. The volatility equation is characterised by the constant parameter α, the autoregressive parameter β and the variance ση2 of the volatility noise. The mean is either imposedequal to zero or estimated with the empirical mean of the series (see equation (8.12)).
268
Applied Quantitative Methods for Trading and Investment
Figure 8.3
The “Load”, “Select” and “Estimate” commands
Since the speciﬁcation of the conditional volatility is an autoregressive process of orderone, the stationarity condition is |β| < 1. Moreover, the volatility ση must be strictly positive. In the estimation procedure the following logistic and logarithm reparameterisations:exp(b)−1ση = exp(sη )β=21 + exp(b)have been considered in order to satisfy the above constraints.The second model is a particular speciﬁcation of the regime switching model introducedby Hamilton. Precisely the distribution of the returns is described by two regimes withthe same mean but different variances and by a constant transition matrix:p00µ + σ0 εt if st = 01 − p11yt =P=1 − p00p11µ + σ1 εt if st = 1where32 st is a two-state Markov chain independent of εt , which is a Gaussian whitenoise with unit variance. The parameters of this model are the mean µ, the low andhigh standard deviation σ0 , σ1 and the transition probabilities p00 , p11 (also called regimepersistence probabilities). As for the log-normal SV model, the logarithm and the logistictransformations ensure the positiveness of the volatilities and constrain the transitionprobabilities to assume values in the (0,1) interval.Before starting the estimation it is necessary to transform the raw time series, expressedin level, into logarithmic returns33 and to set the starting values of the parameters inAccording to the model (8.3), σ0 = exp(α/2) and σ1 = exp((α + β)/2).In the Excel ﬁle “series.xls” there are 899 observations of the daily stock indexes analysed in Section 8.1.1.In the estimation we therefore consider 898 daily return observations.3233
Stochastic Volatility Models
269
the maximisation algorithm.34 Moreover, for the log-normal SV model the returns aremodiﬁed as follows:(8.12)yt∗ = log(yt − y t )2 + 1.27where y t is the empirical mean. Thus, for the log-normal SV model the mean is notestimated but is simply set equal to the empirical mean.While these transformations are automatically done by the estimation procedure, thesetting of the starting parameter values requires a choice by the user from the following options.• Random initialisation: a range of possible values of the parameters is ﬁxed, wherenecessary, and a value is randomly extracted. This method is useful when the userhas no idea about the possible value of the parameters but wants to better investigatethe parametric space. The drawback of this option is that the optimisation algorithmmay be quite time-consuming, because it needs more iterations to converge and theprobability that it does not converge to the global maximum increases and then severaloptimisation runs (with different random starting values) may be required.• Data-driven initialisation: the starting values of the parameters are calculated considering the time series analysed. For example, the sample mean is used as an approximationof the mean of the switching regime model and the empirical variance multiplied byappropriate factors is used for the high and low variance. This alternative helps theuser to speed up the convergence even if he has no opinion on the possible values ofthe parameters.• User initialisation: the starting values of the parameters are directly inserted by the user.In the example, the data-driven initialisation has been selected.During the estimation it is possible to control each step of the algorithm through thecommand MaxControl (see the readme.txt ﬁle for more information). The estimationoutput is then given by the estimated values of the parameters, their standard errors andrelative signiﬁcance test statistics.35Figure 8.4 shows the ﬁnal output of the log-normal SV model for the FTSE100 index.In this example the numerical optimisation ends after 76 iterations, which take 8.32seconds,36 and the log-likelihood37 is −1153.7. The volatility of the FTSE100 index isvery persistent, in fact the autoregressive coefﬁcient of the volatility equation (β) is equalto 0.956. In practice, for ﬁnancial time series this coefﬁcient is very often bigger than 0.9.Figure 8.5 exempliﬁes the graphic output, which consists of the estimated volatilityfor the FTSE100 index along with the historical return series. The estimated volatility is obtained by using the Kalman smoother ĥt/T = E(ht |Y ∗T ), which is howevernot immediately useful. In fact, we are interested in E(σt |Y T ) = E(exp(ht /2)|Y T ), butE(exp(ht /2)|Y T ) = exp(E(ht /2|Y T )). Thus, we consider a ﬁrst-order Taylor expansion34
Recall that data transformations are directly carried out by the programs that require input price levels.The standard errors are calculated following Ruiz (1994) for the log-normal SV model and as the inverse ofthe information matrix for the switching regime model. In both cases the z-statistics asymptotically follow anN (0,1) distribution.36On a Pentium III 933 MHz.37For the log-normal SV model the log-likelihood is computed with the Kalman ﬁlter for the transformed seriesyt∗ , see equation (8.12).35
270
Applied Quantitative Methods for Trading and Investment
Figure 8.4 Estimation output of the log-normal SV model for the FTSE100 index0.050
historical returns
0.0250.000−0.025−0.0500
100
200
300
400
500
600
700
800
900
300
400
500
600
700
800
900
estimated volatility
0.020
0.015
0.0100
100
200
Figure 8.5 Historical returns and estimated volatility for the FTSE100 index obtained with thelog-normal SV model
Stochastic Volatility Models
271
of exp(ht /2) around ĥt/T , and compute the conditional mean and estimate the volatilityin the following way:

htσ̂t/T = E exp2

|Y
T
1ĥt/Tĥt/T∼+ expQt/T= exp282
This computation is performed directly by the program and Figure 8.5 presents the estimated volatility.Figure 8.6 shows the ﬁnal output38 of the switching regime model for the FTSE100index. In this case the numerical optimisation ends after 26 iterations, which take 7.65seconds, and the log-likelihood39 is −2680.18. For this model we can judge the persistence
Figure 8.6
Estimation output of the switching regime model for the FTSE100 index
38It is important to underline that the z-statistics for the transition probabilities are not useful for testingpii = 0, pii = 1, i = 0, 1. In fact, these tests are not standard since they imply testing for the presence of tworegimes (see Davies (1977, 1987) and Hansen (1992, 1996)).39In this case the log-likelihood is computed with the Hamilton ﬁlter for the return series and thus it is notdirectly comparable with the log-likelihood of the log-normal SV model.
272
Applied Quantitative Methods for Trading and Investment
of the volatility by the value taken by the transition (or persistence) probabilities p00 , p11 .They are very high (0.99 and 0.96), conﬁrming the high persistence of the volatility ofthe FTSE100 index. Moreover, the levels of the high and low volatility are perfectly inline with the values of the volatility estimated with the log-normal SV model.In Figure 8.7 the graphic output of the switching regime model is presented. It consistsof the historical return series, the weighted or estimated volatility and the estimatedswitches between regimes.40To estimate the volatility we consider the output of the Kim smoother. Since σt =exp(α/2)(1 − st ) + exp((α + β)/2)st = σ0 (1 − st ) + σ1 st , we can compute:σ̂t/T = E(σt |Y T ) = σ0 P (st = 0|Y T ) + σ1 P (st = 1|Y T )
(8.13)
whereP (st = 0|Y T ) = P (ht = α|Y T ) and P (st = 1|Y T ) = P (ht = α + β|Y T )Finally, it is possible to save the estimated volatility. Since the visualisation of thegraphs is possible only with the commercial version of Ox, if this is not available theprogram allows only the saving of the estimated volatility series. The “SeriesEst” command allows the saving of the following series in an Excel format:41 historical returns,0.05
historical returns
0.00−0.050
100
200
300
400
500
600
700
800
900
300
400
500
600
700
800
900
300
400
500
600
700
800
900
weighted volatility
0.0200.01501.0
100
200
regime shifts
0.5
0
100
200
Figure 8.7 Historical returns, weighted volatility and estimated switches between regimes forthe FTSE100 index obtained with the regime switching modelThe regime is 0 if P (ht = α|Y T ) ≥ 0.5 and 1 otherwise.In the output ﬁle, for the ARSV model, Var1 indicates the historical returns and Var2 the estimated volatilities.For the SRSV, Var1 indicates the historical returns, Var2 the estimated volatilities, Var3 and Var4 the smoothedand ﬁltered probabilities of the high volatility regime and Var5 the regime shifts.4041
Stochastic Volatility Models
Figure 8.8
273
The “Simulation”, “SeriesEst”, “SeriesSim” and “Graph” commands
estimated volatilities and for the switching regime model the smoothed and ﬁltered probabilities of the high volatility regime and the regime shifts. Moreover, the graphs canbe directly saved in a postscript format with the “Graph” command. In both cases theuser should provide a path including the name and extension of the destination ﬁle. The“Graph” command includes also an additional control variable to choose whether or notto plot the series (see Figure 8.8).8.7.1.2 SimulationThe Volatility program also allows simulation of both the models. The “Simulation”command gives the possibility to choose the type of model, the values of the parametersand the length of the simulated series. If the user wants to simulate the model characterisedby the parameters just estimated, the last input of the “Simulation” command must be setto 0, otherwise it has to be replaced by the column vector of the desired parameters.The graphic output of the simulation is composed of the simulated series and theirvolatilities. A ﬁnal possibility is to plot both the estimation and simulation phases (seeFigures 8.9 and 8.10). In particular, for the switching regime model the program plotsthe simulated volatility, which jumps between the low and high level, and the smoothed(weighted) simulated volatility, which is computed in the same way as the estimatedvolatility (see equation (8.13)).
274
Applied Quantitative Methods for Trading and Investment
0.050
historical returns
estimated volatility
0.025
0.020
0.0000.015−0.0250.010
−0.0500
200
400
600
800
0
simulated returns
200
400
600
800
simulated volatility
0.025
0.0250.0200.000
0.015
−0.025
0.010
−0.050
0.0050
250
Figure 8.90.05
500
750
1000 1250 1500
0
250
500
750
1000 1250 1500
Estimation and simulation graphic output of the log-normal SV model
historical returns
weighted volatility
0.0200.000.015−0.0501.0
200
400
600
0
800
200
400
600
800
simulated returns
regime shifts
0.050.5
0.00−0.050
200
400
600
0
8001.0
weighted simulated volatility
500
1000
1500
2000
2500
1500
2000
2500
simulated regime shifts
0.0200.50.015
0
500
Figure 8.10
1000
1500
2000
2500
0
500
1000
Estimation and simulation graphic output of the switching regime model
Stochastic Volatility Models
275
Finally, it is possible to save the simulated volatility. The “SeriesSim” command allowsthe saving of the following series in an Excel format:42 simulated returns, simulatedvolatilities and for the switching regime model the smoothed probabilities of the highvolatility regime and the regime shifts.8.7.1.3 ForecastingThe ﬁnal output given by the Volatility program is the forecasted volatility for the following period. The Kalman and Hamilton ﬁlters also give the prediction density of ht+1 ,then it is possible to forecast the next value of the volatility.For the log-normal SV model, we consider a ﬁrst-order Taylor expansion of exp(ht /2)around ĥT +1/T and by taking the conditional expectation we forecast the volatility in thefollowing way: 