research article markov switching model analysis of implied ...ne the analysis with respect to...

18
Research Article Markov Switching Model Analysis of Implied Volatility for Market Indexes with Applications to S&P 500 and DAX Luca Di Persio 1 and Samuele Vettori 2 1 Department of Computer Science, University of Verona, Strada le Grazie 15, 37134 Verona, Italy 2 Department of Mathematics, University of Trento, Via Sommarive 14, 38123 Trento, Italy Correspondence should be addressed to Luca Di Persio; [email protected] Received 31 May 2014; Revised 26 November 2014; Accepted 26 November 2014; Published 18 December 2014 Academic Editor: Niansheng Tang Copyright © 2014 L. Di Persio and S. Vettori. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. We adopt a regime switching approach to study concrete financial time series with particular emphasis on their volatility characteristics considered in a space-time setting. In particular the volatility parameter is treated as an unobserved state variable whose value in time is given as the outcome of an unobserved, discrete-time and discrete-state, stochastic process represented by a suitable Markov chain. We will take into account two different approaches for inference on Markov switching models, namely, the classical approach based on the maximum likelihood techniques and the Bayesian inference method realized through a Gibbs sampling procedure. en the classical approach shall be tested on data taken from the Standard & Poor’s 500 and the Deutsche Aktien Index series of returns in different time periods. Computations are given for a four-state switching model and obtained numerical results are put beside by explanatory graphs which report the outcomes obtained exploiting both smoothing and filtering algorithms used in the estimation/calibration procedures we proposed to infer on the switching model parameters. 1. Introduction Many financial time series are characterized by abrupt changes in their behaviour, a phenomena that can be implied by a number of both endogeneous and exogeneous facts, oſten far from being forecasted. Examples of such changing factors can be represented, for example, by large financial crises, government policy and political instabilities, natural disasters, and speculative initiatives. Such phenomena have been frequently observed during last decade especially because of the worldwide financial cri- sis which originated during the first years of 2000 and is still running. Indeed such a crisis, oſten referred to as the Global Financial Crisis, has caused a big lack of liquidity for banks, both in USA, Europe, and many countries all over the world, resulting, for example, in a collapse of many financial insti- tutions, a generalized downfall in stock markets, a decline consumer wealth, and an impressive growth of the Eurpean sovereign debt. e reasons behind these phenomena are rather complicated, particularly because of the high num- ber of interconnected point of interests, each of which is driven by specific influences oſten linked between each other. Nevertheless there are mathematical techniques which can be used to point out some general characteristics able to synthe- size some relevant informations and to give an effective help in forecasting future behaviour of certain macroquantities of particular interest. Although linear time series techniques, for example, the autoregressive (AR) model, the moving average (MA) model, and their combination (ARMA), have been success- fully applied in a large number of financial applications, by their own nature they are unable to describe nonlinear dynamic patterns as in the case, for example, of asymmetry and volatility clustering. In order to overcome latter issue various approaches have been developed. Between them and with financial applications in mind, we recall the autore- gressive conditional heteroskedasticity (ARCH) model of Engle, together with its generalised version (GARCH), and the regime switching (RS) model which involves multiple equations, each characterizing the behaviors of quantities of interest in different regimes, and a mechanism allowing the switch between them. Concerning the switching methods Hindawi Publishing Corporation Journal of Mathematics Volume 2014, Article ID 753852, 17 pages http://dx.doi.org/10.1155/2014/753852

Upload: others

Post on 20-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Research ArticleMarkov Switching Model Analysis of Implied Volatility forMarket Indexes with Applications to SampP 500 and DAX

Luca Di Persio1 and Samuele Vettori2

1Department of Computer Science University of Verona Strada le Grazie 15 37134 Verona Italy2Department of Mathematics University of Trento Via Sommarive 14 38123 Trento Italy

Correspondence should be addressed to Luca Di Persio dipersiolucagmailcom

Received 31 May 2014 Revised 26 November 2014 Accepted 26 November 2014 Published 18 December 2014

Academic Editor Niansheng Tang

Copyright copy 2014 L Di Persio and S Vettori This is an open access article distributed under the Creative Commons AttributionLicense which permits unrestricted use distribution and reproduction in any medium provided the original work is properlycited

We adopt a regime switching approach to study concrete financial time series with particular emphasis on their volatilitycharacteristics considered in a space-time setting In particular the volatility parameter is treated as an unobserved state variablewhose value in time is given as the outcome of an unobserved discrete-time and discrete-state stochastic process represented bya suitable Markov chain We will take into account two different approaches for inference on Markov switching models namelythe classical approach based on the maximum likelihood techniques and the Bayesian inference method realized through a Gibbssampling procedure Then the classical approach shall be tested on data taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns in different time periods Computations are given for a four-state switching model and obtainednumerical results are put beside by explanatory graphs which report the outcomes obtained exploiting both smoothing and filteringalgorithms used in the estimationcalibration procedures we proposed to infer on the switching model parameters

1 Introduction

Many financial time series are characterized by abruptchanges in their behaviour a phenomena that can be impliedby a number of both endogeneous and exogeneous factsoften far from being forecasted Examples of such changingfactors can be represented for example by large financialcrises government policy and political instabilities naturaldisasters and speculative initiatives

Such phenomena have been frequently observed duringlast decade especially because of the worldwide financial cri-sis which originated during the first years of 2000 and is stillrunning Indeed such a crisis often referred to as the GlobalFinancial Crisis has caused a big lack of liquidity for banksboth in USA Europe and many countries all over the worldresulting for example in a collapse of many financial insti-tutions a generalized downfall in stock markets a declineconsumer wealth and an impressive growth of the Eurpeansovereign debt The reasons behind these phenomena arerather complicated particularly because of the high num-ber of interconnected point of interests each of which is

driven by specific influences often linked between each otherNevertheless there aremathematical techniques which can beused to point out some general characteristics able to synthe-size some relevant informations and to give an effective helpin forecasting future behaviour of certain macroquantities ofparticular interest

Although linear time series techniques for examplethe autoregressive (AR) model the moving average (MA)model and their combination (ARMA) have been success-fully applied in a large number of financial applicationsby their own nature they are unable to describe nonlineardynamic patterns as in the case for example of asymmetryand volatility clustering In order to overcome latter issuevarious approaches have been developed Between them andwith financial applications in mind we recall the autore-gressive conditional heteroskedasticity (ARCH) model ofEngle together with its generalised version (GARCH) andthe regime switching (RS) model which involves multipleequations each characterizing the behaviors of quantities ofinterest in different regimes and a mechanism allowing theswitch between them Concerning the switching methods

Hindawi Publishing CorporationJournal of MathematicsVolume 2014 Article ID 753852 17 pageshttpdxdoiorg1011552014753852

2 Journal of Mathematics

that can be considered in the RS framework we would liketo cite the threshold autoregressive (TAR) model proposed byTong in [1] in which regime switching is controlled by a fixedthreshold the autoregressive conditional root (ACR) modelof Bec et al (see [2]) where the regime switching betweenstationary and nonstationary state is controlled by a binaryrandom variable and its extension namely the functionalcoefficient autoregressive conditional root (FCACR) modelconsidered by Zhou and Chen in [3] In particular in thiswork we aim at using the RS approach to model aforemen-tioned types of unexpected changes by their dependence onan unobserved variable typically defined as the regime orstate A customaryway to formalize such an approach is giventhrough the following state-space representation

119910119905= 119891 (119878

119905 120579120595) 119905 = 1 119899 119899 isin N

+ 119878119905isin Ω (1)

where 120579 is the vector of problem parameters 120595 is the infor-mation set the state set Ω with |Ω| = 119872 isin N+ is the (finite)set of possible values which can be taken by the the stateprocess 119878 at time 119905 that is 119878

119905isin Ω and 119891 is a suitable func-

tion determining the value of the dependent variable 119910 at anygiven time 119905 isin 1 119899

The simplest type of structure considers two regimes thatis Ω = 1 2 and at most one switch in the time seriesin other words the first 119898 (unknown) observations relateregime 1 while the remaining 119899 minus 119898 data concern regime 2Such an approach can be generalized allowing the system toswitch back and forth between the two regimes with a certainprobability The latter is the case considered by Quandt inhis paper published in 1962 where it is assumed to be theo-retically possible for the system to switch between regimesevery time that a new observation is generated Note thatprevious hypothesis is not realistic in an economic contextsince it contradicts the volatility clustering property typicalof financial time series

The best way to represent the volatility clusters phe-nomenon consists in assuming that the state variable followsa Markov chain and claiming that the probability of havinga switch in the next time is much lower than the probabilityof remaining in the same economic regime The Markovianswitching mechanism was first considered by Goldfeld andQuandt in [4] and then extended by Hamilton to the caseof structural changes in the parameters of an autoregres-sive process (see [5]) When the unobserved state variablethat controls the switching mechanism follows a first-orderMarkov chain the RS model is called Markov SwitchingModel (MSM) In particular the Markovian property of sucha model implies that given 119905 isin 2 119899 the value 119878

119905of the

state variable depends only on 119878119905minus1

a property that turns outto be useful to obtain a good representation of financial datawhere abrupt changes occur occasionally

After Hamiltonrsquos papers Markov switching models havebeen widely applied together with a number of alternativeversions to analyze different type of both economic andfinancial time series for example stock options behaviorsenergy markets trends and interest rates series In what

follows we shall often refer to the following actually rathergeneral form for an MSM

119910119905= 119891 (119878

119905 120579)

119878119905isin 1 2 119872 with probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 119872 119905 = 2 119899

(2)

where the terms 119901119894119895are nothing but the transition prob-

abilities from state 119894 at time 119905 minus 1 to state 119895 at time 119905which determine the stochastic dynamic of the process 119878 =

119878119905119905=1119899

In Section 2 we recall the classical approach to MSM

following [5] and with respect to both serially uncorrelatedand correlated data Then in Section 3 we first introducebasic facts related to the Bayesian inference then we recallthe Gibbs sampling technique and related Monte Carloapproximation method which is later used to infer on theMSM parameters Section 4 is devoted to a goodness of fit(of obtained estimates for parameters of interest) analysiswhile in Section 5 we describe our forecasting MSM-basedprocedure which is then used in Section 6 to analyse both theStandard amp Poorrsquos 500 and the Deutsche Aktien indexes

2 The Classical Approach

In this section we shall use the classical approach (seefor example [5]) to develop procedures which allow us tomake inference on unobserved variables and parameterscharacterizingMSMThemain idea behind such an approachis splitin two steps first we estimate the modelrsquos unknownparameters by a maximum likelihood method secondly weinfer the unobserved switching variable values conditionalon the parameter estimates Along latter lines we shallanalyze two differentMSMsettings namely the case inwhichdata are serially uncorrelated and the case when they areautocorrelated

21 Serially Uncorrelated Data Let us suppose that 119878 =

119878119905119905isin1119879

119879 isin N+ is a discrete time stochastic processrepresented by a first-order Markov chain taking value insome setΩ = 1 119872 with transition probabilities

119901119894119895= P (119878

119905+1= 119895 | 119878

119905= 119894 119878119905minus1

= 119894119905minus1

1198780= 1198940)

= P (119878119905+1

= 119895 | 119878119905= 119894) forall119905 isin 2 119879

(3)

Then the state-space model we want to study is given by

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 120583119872119878119872119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 120590119872119878119872119905

119878119905isin 1 119872 with probabilities 119901

119894119895

(4)

Journal of Mathematics 3

where the variables 119878119896119905 (119896 119905) isin 1 119872 times 1 119879 are

introduced in order to have a slightly compact equation for120583119878119905

and 120590119878119905

in particular 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905=

0 which implies that under regime 119896 for 119896 isin 1 119872parameters of mean and variance are given by 120583

119896and 120590

119896

Let us underline that in (4) the 119910119905are our observed

data for example historical returns of a stock or some indextime series and we suppose that they are locally distributedas Gaussian random variable in the sense that occasionallyjumps could occur for both the mean 120583

119878119905

and the variance1205902

119878119905

In particular we assume that 1205901

lt 1205902

lt sdot sdot sdot lt 120590119872

and we want to estimate these 119872 unobserved values forstandard deviation as well as the 119872 values for the switchingmean Note that we could also take 120583 as a constant obtainingthe so called switching variance problem or 120590 as a constanthaving a switching mean problem The first one is in generalmore interesting in the analysis of financial time series sincevariance is usually interpreted as an indicator for the marketrsquosvolatility

Given themodel described by (4) the conditional densityof 119910119905given 119878

119905is Gaussian with mean 120583

119878119905

and standarddeviation 120590

119878119905

namely its related probability density functionreads as follow

119891119910119905|119878119905

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905)221205902

119878119905 119909 isin R (5)

andwe are leftwith the problem of estimating both the expec-tations 120583

1 120583

119872and the standard deviations 120590

1 120590

119872

parameters a task that is standard to solve bymaximizing theassociated log-likelihood function lnL defined as follows

lnL =

119879

sum

119905=1

ln (119891119910119905|119878119905

) (6)

A different and more realistic scenario is the one character-ized by unobserved values for 119878

119905 In such a case it could be

possible to consider the MSM-inference problem as a two-step procedure consisting in

(i) estimating the parameters of the model by maximiz-ing the log-likelihood function

(ii) making inferences on the state variable 119878119905 119905 =

1 119879 conditional on the estimates obtained atprevious point

Depending on the amount of information we can useinferencing on 119878

119905 we have

(i) filtered probabilities that refer to inferences about 119878119905

conditional on information up to time 119905 namely withrespect to 120595

119905

(ii) smoothed probabilities that refer to inferences about 119878119905

conditional to the whole sample (history) 120595119879

In what follows we describe a step-by-step algorithmwhich allows us to resolve the filtering problem for a sample ofserially uncorrelated data In particular we slightly generalizethe approach given in [6] assuming that the state variable 119878

119905

belongs to a 4-state space set Ω = 1 2 3 4 at every time119905 = 1 119879 Despite 2-state (expansioncontraction) and 3-state (lowmediumhigh volatility regime) models being theusual choices we decided to consider 4-state MSM in orderto refine the analysis with respect to volatility levels aroundthe mean A finer analysis can be also performed even if onehas to take into account the related nonlinear computationalgrowth We first define the log-likelihood function at time 119905

as

119897 (120579 120595119905) = 119897 (120583

1 120583

119872 1205901 120590

119872 120595119905) (7)

where 120579 = (1205831 120583

119872 1205901 120590

119872) is the vector of parame-

ters that we want to estimate Let us note that the 120579 is updatedat every iteration since we maximize with respect to thefunction 119897(120579 120595

119905) at every stage of our step-by-step procedure

In particular the calibrating procedure reads as follows

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities of the homoge-neous Markov chain underlying the state variablethat is

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 isin Ω (8)

Since in the applications we can only count on returntime series we first have to calibrate with respect tothe transition probabilities 119901

119894119895

(1) choose 4 values 1205902

1lt 1205902

2lt 1205902

3lt 1205902

4(eg

1205901

= 01 1205902

= 02 1205903

= 03 and 1205904

= 04)and a positive arbitrary small constant 120575 gt 0for example 120575 = 001

(2) compute for every 119895 = 1 2 3 4 and for every119905 = 1 119879 the values

119887119895= Φ (119910

119905+ 120575) minus Φ (119910

119905minus 120575)

= int

119910119905+120575

119910119905minus120575

1

radic21205871205902119895

exp[

[

(119909 minus 120583119895)2

21205902119895

]

]

(9)

(3) simulate a value in 1 2 3 4 for 119878119905at each time

from the discrete probability vector

(1198871

sum4

119895=1119887119895

1198872

sum4

119895=1119887119895

1198873

sum4

119895=1119887119895

1198874

sum4

119895=1119887119895

) (10)

(4) set the transition probabilities 119901119894119895just by count-

ing the number of transition from state 119894 to state119895 for 119894 119895 = 1 4 in order to obtain thefollowing transition matrix

119875lowast= (

11990111

11990112

11990113

11990114

11990121

11990122

11990123

11990124

11990131

11990132

11990133

11990134

11990141

11990142

11990143

11990144

) (11)

4 Journal of Mathematics

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (12)

Let us note that by definition if 120587(119905) is a 4 times 1 vectorof steady-state probabilities then 120587(119905 + 1) = 120587(119905) forevery 119905 = 1 119879 moreover 120587(119905 + 1) = 119875

lowast120587(119905)

and (see for example [6 pag 71]) we also have that120587(119905) = (119860

119879119860)minus1119860119879[04

1] where 0

4is a 4 times 1 matrix of

zeros and 119860 = (Id4minus119875lowast

14

) Id4is the four dimensional

identity matrix while 14

= (1 1 1 1) that is thevector of steady-state probabilities is the last columnof the matrix (119860

119879119860)minus1119860119879

Next we perform the following steps for 119905 = 1 119879

Step 1 The probability of 119878119905conditional to information set at

time 119905 minus 1 is given by

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

) 119895 = 1 4

(13)

Step 2 Compute the joint density of 119910119905and 119878119905conditional to

the information set 120595119905minus1

119891 (119910119905 119878119905= 119895 | 120595

119905minus1) = 119891 (119910

119905| 119878119905= 119895 120595

119905minus1)

times P (119878119905= 119895 | 120595

119905minus1) 119895 = 1 4

(14)

The marginal density of 119910119905is given by the sum of the joint

density over all values of 119878119905

119891 (119910119905| 120595119905minus1

) =

4

sum

119894=1

119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1) (15)

Step 3 Update the log-likelihood function at time 119905 in thefollowing way

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (16)

and maximize 119897(120579 120595119905) with respect to 120579 = (120583

1 120583

4 1205901

1205904) under the condition 120590

1lt 1205902lt 1205903lt 1205904 to find the

maximum likelihood estimator 120579 for the next time period

Step 4 Once 119910119905is observed at the end of the 119905th iteration we

can update the probability term

P (119878119905= 119895 | 120595

119905)

=119891 (119910119905119878119905= 119895 120595

119905minus1)P (119878

119905= 119895120595119905minus1

)

sum4

119894=1119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1)

119895 = 1 4

(17)

where both 120595119905= 120595119905minus1

119910119905 and 119891(119910

119905| 119878119905= 119894 120595119905minus1

) are com-puted with respect to the estimator 120579 = (120583

1 120583

4 1

4)

22 Serially Correlated Data In some cases it is possible toargue and mathematically test by for example the Durbin-Watson statistics or Breusch-Godfrey test for the presence ofa serial correlation (or autocorrelation) between data belong-ing to a certain time series of interest Such a characteristicis often analyzed in signal processing scenario but examplescan be also found in economic meteorological or sociolog-ical data sets especially in connection with autocorrelationof errors in related forecasting procedure In particular if wesuppose that the observed variable 119910

119905linearly depends on

its previous value then we obtain a first-order autoregressivepattern and the following state-space model applies

119910119905minus 120583119878119905

= 120601 (119910119905minus1

minus 120583119878119905minus1

) + 120598119905 119905 = 1 2 119879

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205831S1119905

+ sdot sdot sdot + 120583119872119878119872119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 120590119872119878119872119905

119878119905isin 1 119872 with probabilities 119901

119894119895

(18)

where 119901119894119895

= P(119878119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 119872 and 119878

119896119905

and (119896 119905) isin 1 119872 times 1 119879 are the same variablesintroduced in the previous section that is 119878

119896119905= 1 if 119878

119905= 119896

otherwise 119878119896119905

= 0In this situation if the state 119878

119905is known for every 119905 =

1 119879 we need 119878119905and 119878

119905minus1to compute the density of 119910

119905

conditional to past information 120595119905minus1

indeed we have

lnL =

119879

sum

119905=1

ln (119891119910119905|120595119905minus1119878119905119878119905minus1

) (19)

where

119891119910119905|120595119905minus1119878119905119878119905minus1

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905minus120601(119910119905minus1minus120583119878119905minus1))221205902

119878119905 119909 isin R

(20)

If 119878119905are unobserved (and as before we assume that the

state variable can take the four values 1 2 3 4) we apply thefollowing algorithm in order to resolve the filtering problemfor a sample of serially correlated data

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4 (21)

We apply the same trick as before but firstly we haveto estimate the parameter 120601 in order to obtain thisvalue we can use the least square methods (see forexample [7]) that is

120601 =sum119879

119905=1119910119905119910119905+1

sum119879

119905=11199102119905

(22)

Journal of Mathematics 5

Thenwe compute 119911119905= 119910119905minus120601119910119905minus1

for every 119905 = 1 119879

and consider the values 119887119895= Φ(119911

119905+ 120575) minus Φ(119911

119905minus 120575)

(we apply the Normal distribution function to 119911119905+ 120575

instead of 119910119905+ 120575 as done before)

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (23)

taking the last column of the matrix (119860119879119860)minus1119860119879 (see

procedure in Section 21 for details)Next perform the following steps for 119905 = 1 119879

Step 1 Compute the probabilities of 119878119905conditional to infor-

mation set at time 119905 minus 1 for 119895 = 1 4

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

=

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

)

(24)

Step 2 Compute the joint density of 119910119905 119878119905 and 119878

119905minus1given

120595119905minus1

119891 (119910119905 119878119905 119878119905minus1

| 120595119905minus1

) = 119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(25)

where 119891(119910119905

| 119878119905

= 119895 119878119905minus1

= 119894 120595119905minus1

) is given by (20) andP(119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

) is computed in Step 1 The marginaldensity of119910

119905conditional on120595

119905minus1is obtained by summing over

all values of 119878119905and 119878119905minus1

119891 (119910119905| 120595119905minus1

) =

4

sum

119895=1

4

sum

119894=1

119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(26)

Step 3 The log-likelihood function at time 119905 is again

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (27)

and it can be maximized with respect to 120579 = (1205831 120583

4

1205901 120590

4) under condition 120590

1lt 1205902

lt 1205903

lt 1205904 giving the

maximum likelihood estimator 120579 for the next time period

Step 4 Update the joint probabilities of 119878119905and 119878

119905minus1condi-

tional to the new information set 120595119905 using the estimator

120579 computed in Step 3 by maximizing the log-likelihoodfunction 119897(120579 120595

119905)

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905)

=119891 (119910119905 119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

119891 (119910119905| 120595119905minus1

) 119894 119895 = 1 4

(28)

Then compute the updated probabilities of 119878119905given 120595

119905by

summing the joint probabilities over 119878119905minus1

as follows

P (119878119905= 119895 | 120595

119905) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905) forall119895 = 1 4

(29)

The Smoothing Algorithm Once we have run this procedurewe are provided with the filtered probabilities that is thevalues P(119878

119905= 119895 | 120595

119905) for 119895 = 1 4 and for each 119905 = 1 119879

(in addition to the estimator 120579)Sometimes it is required to estimate probabilities of 119878

119905

given the whole sample information that is

P (119878119905= 119895 | 120595

119879) = P (119878

119905= 119895 | 119910

1 119910

119879) forall119895 = 1 4

(30)

which are called smoothed probabilities We are going to showhow these new probabilities can be computed from previousprocedure (the same algorithm although with some obviouschanges can be still used starting from procedure in Section21)

Since the last iteration of the algorithm gives us theprobabilities P(119878

119879= 119895 | 120595

119879) for 119895 = 1 4 we can start

from these values and use the following procedure by doingthe two steps for every 119905 = 119879 minus 1 119879 minus 2 2 1

Step 1 For 119894 119895 = 1 4 compute

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905)

= P (119878119905+1

= 119895 | 120595119879)P (119878119905= 119894 119878119905+1

= 119895 | 120595119905)

P (119878119905+1

= 119895 | 120595119905)

(lowast)

Remark 1 Note that equality (lowast) that is

P (119878119905= 119894 | 119878

119905+1= 119895 120595

119879) = P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905) (31)

holds only under a particular condition namely

119891 (ℎ119905+1119879

| 119878119905+1

= 119895 119878119905= 119894 120595119905) = 119891 (ℎ

119905+1119879| 119878119905+1

= 119895 120595119905)

(32)

where ℎ119905+1119879

= (119910119905+1

119910119879)1015840 (see [6] for the proof) Equa-

tion (32) suggests that if 119878119905+1

were known then 119910119905+1

wouldcontain no information about 119878

119905beyond that contained in

119878119905+1

and 120595119905and does not hold for every state-space model

with regime switching (see for example [6 Ch 5]) in whichcase the smoothing algorithm involves an approximation

Step 2 For 119894 = 1 4 compute

P (119878119905= 119894 | 120595

119879) =

4

sum

119895=1

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879) (33)

3 The Gibbs Sampling Approach

31 An Introduction to Bayesian Inference Under the generaltitle Bayesian inference we can collect a large number ofdifferent concrete procedures nevertheless they are all basedon smart use of the Bayesrsquo rule which is used to update theprobability estimate for a hypothesis as additional evidenceis learned (see for example [8 9]) In particular within

6 Journal of Mathematics

the Bayesian framework the parameters for example let uscollect them in a vector called 120579 which characterize a certainstatistic model and are treated as random variables with theirown probability distributions let us say 119891(120579) which plays therole of a prior distribution since it is defined before taking intoaccount the sample data 119910 Therefore exploiting the Bayesrsquotheorem and denoting by 119891(119910 | 120579) the likelihood of 119910 of theinterested statistic model we have that

119891 (120579 | 119910) =119891 (119910 | 120579) 119891 (120579)

119891 (119910) (34)

where 119891(120579 | 119910) is the joint posterior distribution of theparameters The denominator 119891(119910) defines the marginallikelihood of 119910 and can be taken as a constant obtaining theproportion

119891 (120579 | 119910) prop 119891 (119910 | 120579) 119891 (120579) (35)

It is straightforward to note that the most critical part of theBayesian inference procedure relies in the choice of a suitableprior distribution since it has to agree with parametersconstraints An effective answer to latter issue is given by theso called conjugate prior distribution namely the distributionobtained when the conjugate prior is combined with thelikelihood function Let us note that the posterior distribution119891(120579 | 119910) is in the same family as the prior distribution

As an example if the likelihood function is Gaussianit can be shown that the conjugate prior for the mean 120583 isthe Gaussian distribution whereas the conjugate prior forthe variance is the inverted Gamma distribution (see forexample [9 10])

32 Gibbs Sampling A general problem in Statistics concernsthe question of how a sequence of observations which cannotbe directly sampled can be simulated for example by meanof some multivariate probability distribution with a prefixedprecision degree of accuracy Such kind of problems canbe successfully attacked by Monte Carlo Markov Chain(MCMC) simulation methods see for example [11ndash13] andin particular using the so called Gibbs Sampling techniquewhich allows to approximate joint andmarginal distributionsby sampling from conditional distributions see for example[14ndash16]

Let us suppose that we have the joint density of 119896 randomvariables for example 119891 = 119891(119911

1 1199112 119911

119896) fix 119905 isin 1 119896

and that we are interested in in obtaining characteristics ofthe 119911119905-marginal namely

119891 (119911119905) = int sdot sdot sdot int 119891 (119911

1 1199112 119911

119896) 1198891199111sdot sdot sdot 119889119911119905minus1

119889119911119905+1

sdot sdot sdot 119889119911119896

(36)

such as the relatedmean andor variance In those cases whenthe joint density is not given or the above integral turnsout to be difficult to treat for example an explicit solutiondoes not exist but we know the complete set of conditionaldensities denoted by 119891(119911t | 119911

119895 =119905) 119905 = 1 2 119896 with

119911119895 =119905

= 1199111 119911

119905minus1 119911119905+1

119911119896 then the Gibbs Sampling

method allows us to generate a sample 1199111198951 119911119895

2 119911

119895

119896from the

joint density119891(1199111 1199112 119911

119896)without requiring that we know

either the joint density or the marginal densities With thefollowing procedure we recall the basic ideas on which theGibbs Sampling approach is based given an arbitrary startingset of values (1199110

2 119911

0

119896)

Step 1 Draw 1199111

1from 119891(119911

1| 1199110

2 119911

0

119896)

Step 2 Draw 1199111

2from 119891(119911

2| 1199111

1 1199110

3 119911

0

119896)

Step 3 Draw 1199111

3from 119891(119911

3| 1199111

1 1199111

2 1199110

4 119911

0

119896)

Step k Finally draw 1199111

119896from 119891(119911

119896| 1199111

1 119911

1

119896minus1) to complete

the first iterationThe steps from 1 through 119896 can be iterated 119869 times to get

(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 1 2 119869

In [17] S Geman and D Geman showed that both thejoint and marginal distributions of generated (119911

119895

1 119911119895

2 119911

119895

119896)

converge at an exponential rate to the joint and marginaldistributions of 119911

1 1199112 119911

119896 as 119869 rarr infin Thus the joint

and marginal distributions of 1199111 1199112 119911

119896can be approxi-

mated by the empirical distributions of 119872 simulated values(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 119871 + 1 119871 +119872 where 119871 is large enough

to assure the convergence of the Gibbs sampler Moreover119872can be chosen to reach the required precision with respect tothe empirical distribution of interest

In the MSM framework we do not have conditionaldistributions 119891(119911

119905| 119911119895 =119905

) 119905 = 1 2 119896 and we are left withthe problem of estimate parameters 119911

119894 119894 = 1 119896 Latter

problem can be solved exploiting Bayesian inference resultsas we shall state in the next section

33 Gibbs Sampling for Markov Switching Models A majorproblem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of themodel are dependent on an unobserved variable let us say119878119905 We saw that in the classical framework inference on

Markov switching models consists first in estimating themodelrsquos unknown parameters via maximum likelihood theninference on the unobserved Markov switching variable 119878

119879=

(1198781 1198782 119878

119879) conditional on the parameter estimates has

to be perfomedIn the Bayesian analysis both the parameters of themodel

and the switching variables 119878119905 119905 = 1 119879 are treated as ran-

dom variables Thus inference on 119878119879is based on a joint dis-

tribution no more on a conditional one By employing Gibbssampling techniques Albert and Chib (see [14]) providedan easy to implement algorithm for the Bayesian analysis ofMarkov switching models In particular in their work theparameters of the model and 119878

119905 119905 = 1 119879 are treated as

missing data and they are generated from appropriate con-ditional distributions using Gibbs sampling method As anexample let us consider the following simplemodel with two-state Markov switching mean and variance

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 2: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

2 Journal of Mathematics

that can be considered in the RS framework we would liketo cite the threshold autoregressive (TAR) model proposed byTong in [1] in which regime switching is controlled by a fixedthreshold the autoregressive conditional root (ACR) modelof Bec et al (see [2]) where the regime switching betweenstationary and nonstationary state is controlled by a binaryrandom variable and its extension namely the functionalcoefficient autoregressive conditional root (FCACR) modelconsidered by Zhou and Chen in [3] In particular in thiswork we aim at using the RS approach to model aforemen-tioned types of unexpected changes by their dependence onan unobserved variable typically defined as the regime orstate A customaryway to formalize such an approach is giventhrough the following state-space representation

119910119905= 119891 (119878

119905 120579120595) 119905 = 1 119899 119899 isin N

+ 119878119905isin Ω (1)

where 120579 is the vector of problem parameters 120595 is the infor-mation set the state set Ω with |Ω| = 119872 isin N+ is the (finite)set of possible values which can be taken by the the stateprocess 119878 at time 119905 that is 119878

119905isin Ω and 119891 is a suitable func-

tion determining the value of the dependent variable 119910 at anygiven time 119905 isin 1 119899

The simplest type of structure considers two regimes thatis Ω = 1 2 and at most one switch in the time seriesin other words the first 119898 (unknown) observations relateregime 1 while the remaining 119899 minus 119898 data concern regime 2Such an approach can be generalized allowing the system toswitch back and forth between the two regimes with a certainprobability The latter is the case considered by Quandt inhis paper published in 1962 where it is assumed to be theo-retically possible for the system to switch between regimesevery time that a new observation is generated Note thatprevious hypothesis is not realistic in an economic contextsince it contradicts the volatility clustering property typicalof financial time series

The best way to represent the volatility clusters phe-nomenon consists in assuming that the state variable followsa Markov chain and claiming that the probability of havinga switch in the next time is much lower than the probabilityof remaining in the same economic regime The Markovianswitching mechanism was first considered by Goldfeld andQuandt in [4] and then extended by Hamilton to the caseof structural changes in the parameters of an autoregres-sive process (see [5]) When the unobserved state variablethat controls the switching mechanism follows a first-orderMarkov chain the RS model is called Markov SwitchingModel (MSM) In particular the Markovian property of sucha model implies that given 119905 isin 2 119899 the value 119878

119905of the

state variable depends only on 119878119905minus1

a property that turns outto be useful to obtain a good representation of financial datawhere abrupt changes occur occasionally

After Hamiltonrsquos papers Markov switching models havebeen widely applied together with a number of alternativeversions to analyze different type of both economic andfinancial time series for example stock options behaviorsenergy markets trends and interest rates series In what

follows we shall often refer to the following actually rathergeneral form for an MSM

119910119905= 119891 (119878

119905 120579)

119878119905isin 1 2 119872 with probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 119872 119905 = 2 119899

(2)

where the terms 119901119894119895are nothing but the transition prob-

abilities from state 119894 at time 119905 minus 1 to state 119895 at time 119905which determine the stochastic dynamic of the process 119878 =

119878119905119905=1119899

In Section 2 we recall the classical approach to MSM

following [5] and with respect to both serially uncorrelatedand correlated data Then in Section 3 we first introducebasic facts related to the Bayesian inference then we recallthe Gibbs sampling technique and related Monte Carloapproximation method which is later used to infer on theMSM parameters Section 4 is devoted to a goodness of fit(of obtained estimates for parameters of interest) analysiswhile in Section 5 we describe our forecasting MSM-basedprocedure which is then used in Section 6 to analyse both theStandard amp Poorrsquos 500 and the Deutsche Aktien indexes

2 The Classical Approach

In this section we shall use the classical approach (seefor example [5]) to develop procedures which allow us tomake inference on unobserved variables and parameterscharacterizingMSMThemain idea behind such an approachis splitin two steps first we estimate the modelrsquos unknownparameters by a maximum likelihood method secondly weinfer the unobserved switching variable values conditionalon the parameter estimates Along latter lines we shallanalyze two differentMSMsettings namely the case inwhichdata are serially uncorrelated and the case when they areautocorrelated

21 Serially Uncorrelated Data Let us suppose that 119878 =

119878119905119905isin1119879

119879 isin N+ is a discrete time stochastic processrepresented by a first-order Markov chain taking value insome setΩ = 1 119872 with transition probabilities

119901119894119895= P (119878

119905+1= 119895 | 119878

119905= 119894 119878119905minus1

= 119894119905minus1

1198780= 1198940)

= P (119878119905+1

= 119895 | 119878119905= 119894) forall119905 isin 2 119879

(3)

Then the state-space model we want to study is given by

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 120583119872119878119872119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 120590119872119878119872119905

119878119905isin 1 119872 with probabilities 119901

119894119895

(4)

Journal of Mathematics 3

where the variables 119878119896119905 (119896 119905) isin 1 119872 times 1 119879 are

introduced in order to have a slightly compact equation for120583119878119905

and 120590119878119905

in particular 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905=

0 which implies that under regime 119896 for 119896 isin 1 119872parameters of mean and variance are given by 120583

119896and 120590

119896

Let us underline that in (4) the 119910119905are our observed

data for example historical returns of a stock or some indextime series and we suppose that they are locally distributedas Gaussian random variable in the sense that occasionallyjumps could occur for both the mean 120583

119878119905

and the variance1205902

119878119905

In particular we assume that 1205901

lt 1205902

lt sdot sdot sdot lt 120590119872

and we want to estimate these 119872 unobserved values forstandard deviation as well as the 119872 values for the switchingmean Note that we could also take 120583 as a constant obtainingthe so called switching variance problem or 120590 as a constanthaving a switching mean problem The first one is in generalmore interesting in the analysis of financial time series sincevariance is usually interpreted as an indicator for the marketrsquosvolatility

Given themodel described by (4) the conditional densityof 119910119905given 119878

119905is Gaussian with mean 120583

119878119905

and standarddeviation 120590

119878119905

namely its related probability density functionreads as follow

119891119910119905|119878119905

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905)221205902

119878119905 119909 isin R (5)

andwe are leftwith the problem of estimating both the expec-tations 120583

1 120583

119872and the standard deviations 120590

1 120590

119872

parameters a task that is standard to solve bymaximizing theassociated log-likelihood function lnL defined as follows

lnL =

119879

sum

119905=1

ln (119891119910119905|119878119905

) (6)

A different and more realistic scenario is the one character-ized by unobserved values for 119878

119905 In such a case it could be

possible to consider the MSM-inference problem as a two-step procedure consisting in

(i) estimating the parameters of the model by maximiz-ing the log-likelihood function

(ii) making inferences on the state variable 119878119905 119905 =

1 119879 conditional on the estimates obtained atprevious point

Depending on the amount of information we can useinferencing on 119878

119905 we have

(i) filtered probabilities that refer to inferences about 119878119905

conditional on information up to time 119905 namely withrespect to 120595

119905

(ii) smoothed probabilities that refer to inferences about 119878119905

conditional to the whole sample (history) 120595119879

In what follows we describe a step-by-step algorithmwhich allows us to resolve the filtering problem for a sample ofserially uncorrelated data In particular we slightly generalizethe approach given in [6] assuming that the state variable 119878

119905

belongs to a 4-state space set Ω = 1 2 3 4 at every time119905 = 1 119879 Despite 2-state (expansioncontraction) and 3-state (lowmediumhigh volatility regime) models being theusual choices we decided to consider 4-state MSM in orderto refine the analysis with respect to volatility levels aroundthe mean A finer analysis can be also performed even if onehas to take into account the related nonlinear computationalgrowth We first define the log-likelihood function at time 119905

as

119897 (120579 120595119905) = 119897 (120583

1 120583

119872 1205901 120590

119872 120595119905) (7)

where 120579 = (1205831 120583

119872 1205901 120590

119872) is the vector of parame-

ters that we want to estimate Let us note that the 120579 is updatedat every iteration since we maximize with respect to thefunction 119897(120579 120595

119905) at every stage of our step-by-step procedure

In particular the calibrating procedure reads as follows

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities of the homoge-neous Markov chain underlying the state variablethat is

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 isin Ω (8)

Since in the applications we can only count on returntime series we first have to calibrate with respect tothe transition probabilities 119901

119894119895

(1) choose 4 values 1205902

1lt 1205902

2lt 1205902

3lt 1205902

4(eg

1205901

= 01 1205902

= 02 1205903

= 03 and 1205904

= 04)and a positive arbitrary small constant 120575 gt 0for example 120575 = 001

(2) compute for every 119895 = 1 2 3 4 and for every119905 = 1 119879 the values

119887119895= Φ (119910

119905+ 120575) minus Φ (119910

119905minus 120575)

= int

119910119905+120575

119910119905minus120575

1

radic21205871205902119895

exp[

[

(119909 minus 120583119895)2

21205902119895

]

]

(9)

(3) simulate a value in 1 2 3 4 for 119878119905at each time

from the discrete probability vector

(1198871

sum4

119895=1119887119895

1198872

sum4

119895=1119887119895

1198873

sum4

119895=1119887119895

1198874

sum4

119895=1119887119895

) (10)

(4) set the transition probabilities 119901119894119895just by count-

ing the number of transition from state 119894 to state119895 for 119894 119895 = 1 4 in order to obtain thefollowing transition matrix

119875lowast= (

11990111

11990112

11990113

11990114

11990121

11990122

11990123

11990124

11990131

11990132

11990133

11990134

11990141

11990142

11990143

11990144

) (11)

4 Journal of Mathematics

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (12)

Let us note that by definition if 120587(119905) is a 4 times 1 vectorof steady-state probabilities then 120587(119905 + 1) = 120587(119905) forevery 119905 = 1 119879 moreover 120587(119905 + 1) = 119875

lowast120587(119905)

and (see for example [6 pag 71]) we also have that120587(119905) = (119860

119879119860)minus1119860119879[04

1] where 0

4is a 4 times 1 matrix of

zeros and 119860 = (Id4minus119875lowast

14

) Id4is the four dimensional

identity matrix while 14

= (1 1 1 1) that is thevector of steady-state probabilities is the last columnof the matrix (119860

119879119860)minus1119860119879

Next we perform the following steps for 119905 = 1 119879

Step 1 The probability of 119878119905conditional to information set at

time 119905 minus 1 is given by

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

) 119895 = 1 4

(13)

Step 2 Compute the joint density of 119910119905and 119878119905conditional to

the information set 120595119905minus1

119891 (119910119905 119878119905= 119895 | 120595

119905minus1) = 119891 (119910

119905| 119878119905= 119895 120595

119905minus1)

times P (119878119905= 119895 | 120595

119905minus1) 119895 = 1 4

(14)

The marginal density of 119910119905is given by the sum of the joint

density over all values of 119878119905

119891 (119910119905| 120595119905minus1

) =

4

sum

119894=1

119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1) (15)

Step 3 Update the log-likelihood function at time 119905 in thefollowing way

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (16)

and maximize 119897(120579 120595119905) with respect to 120579 = (120583

1 120583

4 1205901

1205904) under the condition 120590

1lt 1205902lt 1205903lt 1205904 to find the

maximum likelihood estimator 120579 for the next time period

Step 4 Once 119910119905is observed at the end of the 119905th iteration we

can update the probability term

P (119878119905= 119895 | 120595

119905)

=119891 (119910119905119878119905= 119895 120595

119905minus1)P (119878

119905= 119895120595119905minus1

)

sum4

119894=1119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1)

119895 = 1 4

(17)

where both 120595119905= 120595119905minus1

119910119905 and 119891(119910

119905| 119878119905= 119894 120595119905minus1

) are com-puted with respect to the estimator 120579 = (120583

1 120583

4 1

4)

22 Serially Correlated Data In some cases it is possible toargue and mathematically test by for example the Durbin-Watson statistics or Breusch-Godfrey test for the presence ofa serial correlation (or autocorrelation) between data belong-ing to a certain time series of interest Such a characteristicis often analyzed in signal processing scenario but examplescan be also found in economic meteorological or sociolog-ical data sets especially in connection with autocorrelationof errors in related forecasting procedure In particular if wesuppose that the observed variable 119910

119905linearly depends on

its previous value then we obtain a first-order autoregressivepattern and the following state-space model applies

119910119905minus 120583119878119905

= 120601 (119910119905minus1

minus 120583119878119905minus1

) + 120598119905 119905 = 1 2 119879

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205831S1119905

+ sdot sdot sdot + 120583119872119878119872119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 120590119872119878119872119905

119878119905isin 1 119872 with probabilities 119901

119894119895

(18)

where 119901119894119895

= P(119878119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 119872 and 119878

119896119905

and (119896 119905) isin 1 119872 times 1 119879 are the same variablesintroduced in the previous section that is 119878

119896119905= 1 if 119878

119905= 119896

otherwise 119878119896119905

= 0In this situation if the state 119878

119905is known for every 119905 =

1 119879 we need 119878119905and 119878

119905minus1to compute the density of 119910

119905

conditional to past information 120595119905minus1

indeed we have

lnL =

119879

sum

119905=1

ln (119891119910119905|120595119905minus1119878119905119878119905minus1

) (19)

where

119891119910119905|120595119905minus1119878119905119878119905minus1

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905minus120601(119910119905minus1minus120583119878119905minus1))221205902

119878119905 119909 isin R

(20)

If 119878119905are unobserved (and as before we assume that the

state variable can take the four values 1 2 3 4) we apply thefollowing algorithm in order to resolve the filtering problemfor a sample of serially correlated data

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4 (21)

We apply the same trick as before but firstly we haveto estimate the parameter 120601 in order to obtain thisvalue we can use the least square methods (see forexample [7]) that is

120601 =sum119879

119905=1119910119905119910119905+1

sum119879

119905=11199102119905

(22)

Journal of Mathematics 5

Thenwe compute 119911119905= 119910119905minus120601119910119905minus1

for every 119905 = 1 119879

and consider the values 119887119895= Φ(119911

119905+ 120575) minus Φ(119911

119905minus 120575)

(we apply the Normal distribution function to 119911119905+ 120575

instead of 119910119905+ 120575 as done before)

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (23)

taking the last column of the matrix (119860119879119860)minus1119860119879 (see

procedure in Section 21 for details)Next perform the following steps for 119905 = 1 119879

Step 1 Compute the probabilities of 119878119905conditional to infor-

mation set at time 119905 minus 1 for 119895 = 1 4

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

=

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

)

(24)

Step 2 Compute the joint density of 119910119905 119878119905 and 119878

119905minus1given

120595119905minus1

119891 (119910119905 119878119905 119878119905minus1

| 120595119905minus1

) = 119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(25)

where 119891(119910119905

| 119878119905

= 119895 119878119905minus1

= 119894 120595119905minus1

) is given by (20) andP(119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

) is computed in Step 1 The marginaldensity of119910

119905conditional on120595

119905minus1is obtained by summing over

all values of 119878119905and 119878119905minus1

119891 (119910119905| 120595119905minus1

) =

4

sum

119895=1

4

sum

119894=1

119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(26)

Step 3 The log-likelihood function at time 119905 is again

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (27)

and it can be maximized with respect to 120579 = (1205831 120583

4

1205901 120590

4) under condition 120590

1lt 1205902

lt 1205903

lt 1205904 giving the

maximum likelihood estimator 120579 for the next time period

Step 4 Update the joint probabilities of 119878119905and 119878

119905minus1condi-

tional to the new information set 120595119905 using the estimator

120579 computed in Step 3 by maximizing the log-likelihoodfunction 119897(120579 120595

119905)

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905)

=119891 (119910119905 119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

119891 (119910119905| 120595119905minus1

) 119894 119895 = 1 4

(28)

Then compute the updated probabilities of 119878119905given 120595

119905by

summing the joint probabilities over 119878119905minus1

as follows

P (119878119905= 119895 | 120595

119905) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905) forall119895 = 1 4

(29)

The Smoothing Algorithm Once we have run this procedurewe are provided with the filtered probabilities that is thevalues P(119878

119905= 119895 | 120595

119905) for 119895 = 1 4 and for each 119905 = 1 119879

(in addition to the estimator 120579)Sometimes it is required to estimate probabilities of 119878

119905

given the whole sample information that is

P (119878119905= 119895 | 120595

119879) = P (119878

119905= 119895 | 119910

1 119910

119879) forall119895 = 1 4

(30)

which are called smoothed probabilities We are going to showhow these new probabilities can be computed from previousprocedure (the same algorithm although with some obviouschanges can be still used starting from procedure in Section21)

Since the last iteration of the algorithm gives us theprobabilities P(119878

119879= 119895 | 120595

119879) for 119895 = 1 4 we can start

from these values and use the following procedure by doingthe two steps for every 119905 = 119879 minus 1 119879 minus 2 2 1

Step 1 For 119894 119895 = 1 4 compute

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905)

= P (119878119905+1

= 119895 | 120595119879)P (119878119905= 119894 119878119905+1

= 119895 | 120595119905)

P (119878119905+1

= 119895 | 120595119905)

(lowast)

Remark 1 Note that equality (lowast) that is

P (119878119905= 119894 | 119878

119905+1= 119895 120595

119879) = P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905) (31)

holds only under a particular condition namely

119891 (ℎ119905+1119879

| 119878119905+1

= 119895 119878119905= 119894 120595119905) = 119891 (ℎ

119905+1119879| 119878119905+1

= 119895 120595119905)

(32)

where ℎ119905+1119879

= (119910119905+1

119910119879)1015840 (see [6] for the proof) Equa-

tion (32) suggests that if 119878119905+1

were known then 119910119905+1

wouldcontain no information about 119878

119905beyond that contained in

119878119905+1

and 120595119905and does not hold for every state-space model

with regime switching (see for example [6 Ch 5]) in whichcase the smoothing algorithm involves an approximation

Step 2 For 119894 = 1 4 compute

P (119878119905= 119894 | 120595

119879) =

4

sum

119895=1

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879) (33)

3 The Gibbs Sampling Approach

31 An Introduction to Bayesian Inference Under the generaltitle Bayesian inference we can collect a large number ofdifferent concrete procedures nevertheless they are all basedon smart use of the Bayesrsquo rule which is used to update theprobability estimate for a hypothesis as additional evidenceis learned (see for example [8 9]) In particular within

6 Journal of Mathematics

the Bayesian framework the parameters for example let uscollect them in a vector called 120579 which characterize a certainstatistic model and are treated as random variables with theirown probability distributions let us say 119891(120579) which plays therole of a prior distribution since it is defined before taking intoaccount the sample data 119910 Therefore exploiting the Bayesrsquotheorem and denoting by 119891(119910 | 120579) the likelihood of 119910 of theinterested statistic model we have that

119891 (120579 | 119910) =119891 (119910 | 120579) 119891 (120579)

119891 (119910) (34)

where 119891(120579 | 119910) is the joint posterior distribution of theparameters The denominator 119891(119910) defines the marginallikelihood of 119910 and can be taken as a constant obtaining theproportion

119891 (120579 | 119910) prop 119891 (119910 | 120579) 119891 (120579) (35)

It is straightforward to note that the most critical part of theBayesian inference procedure relies in the choice of a suitableprior distribution since it has to agree with parametersconstraints An effective answer to latter issue is given by theso called conjugate prior distribution namely the distributionobtained when the conjugate prior is combined with thelikelihood function Let us note that the posterior distribution119891(120579 | 119910) is in the same family as the prior distribution

As an example if the likelihood function is Gaussianit can be shown that the conjugate prior for the mean 120583 isthe Gaussian distribution whereas the conjugate prior forthe variance is the inverted Gamma distribution (see forexample [9 10])

32 Gibbs Sampling A general problem in Statistics concernsthe question of how a sequence of observations which cannotbe directly sampled can be simulated for example by meanof some multivariate probability distribution with a prefixedprecision degree of accuracy Such kind of problems canbe successfully attacked by Monte Carlo Markov Chain(MCMC) simulation methods see for example [11ndash13] andin particular using the so called Gibbs Sampling techniquewhich allows to approximate joint andmarginal distributionsby sampling from conditional distributions see for example[14ndash16]

Let us suppose that we have the joint density of 119896 randomvariables for example 119891 = 119891(119911

1 1199112 119911

119896) fix 119905 isin 1 119896

and that we are interested in in obtaining characteristics ofthe 119911119905-marginal namely

119891 (119911119905) = int sdot sdot sdot int 119891 (119911

1 1199112 119911

119896) 1198891199111sdot sdot sdot 119889119911119905minus1

119889119911119905+1

sdot sdot sdot 119889119911119896

(36)

such as the relatedmean andor variance In those cases whenthe joint density is not given or the above integral turnsout to be difficult to treat for example an explicit solutiondoes not exist but we know the complete set of conditionaldensities denoted by 119891(119911t | 119911

119895 =119905) 119905 = 1 2 119896 with

119911119895 =119905

= 1199111 119911

119905minus1 119911119905+1

119911119896 then the Gibbs Sampling

method allows us to generate a sample 1199111198951 119911119895

2 119911

119895

119896from the

joint density119891(1199111 1199112 119911

119896)without requiring that we know

either the joint density or the marginal densities With thefollowing procedure we recall the basic ideas on which theGibbs Sampling approach is based given an arbitrary startingset of values (1199110

2 119911

0

119896)

Step 1 Draw 1199111

1from 119891(119911

1| 1199110

2 119911

0

119896)

Step 2 Draw 1199111

2from 119891(119911

2| 1199111

1 1199110

3 119911

0

119896)

Step 3 Draw 1199111

3from 119891(119911

3| 1199111

1 1199111

2 1199110

4 119911

0

119896)

Step k Finally draw 1199111

119896from 119891(119911

119896| 1199111

1 119911

1

119896minus1) to complete

the first iterationThe steps from 1 through 119896 can be iterated 119869 times to get

(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 1 2 119869

In [17] S Geman and D Geman showed that both thejoint and marginal distributions of generated (119911

119895

1 119911119895

2 119911

119895

119896)

converge at an exponential rate to the joint and marginaldistributions of 119911

1 1199112 119911

119896 as 119869 rarr infin Thus the joint

and marginal distributions of 1199111 1199112 119911

119896can be approxi-

mated by the empirical distributions of 119872 simulated values(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 119871 + 1 119871 +119872 where 119871 is large enough

to assure the convergence of the Gibbs sampler Moreover119872can be chosen to reach the required precision with respect tothe empirical distribution of interest

In the MSM framework we do not have conditionaldistributions 119891(119911

119905| 119911119895 =119905

) 119905 = 1 2 119896 and we are left withthe problem of estimate parameters 119911

119894 119894 = 1 119896 Latter

problem can be solved exploiting Bayesian inference resultsas we shall state in the next section

33 Gibbs Sampling for Markov Switching Models A majorproblem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of themodel are dependent on an unobserved variable let us say119878119905 We saw that in the classical framework inference on

Markov switching models consists first in estimating themodelrsquos unknown parameters via maximum likelihood theninference on the unobserved Markov switching variable 119878

119879=

(1198781 1198782 119878

119879) conditional on the parameter estimates has

to be perfomedIn the Bayesian analysis both the parameters of themodel

and the switching variables 119878119905 119905 = 1 119879 are treated as ran-

dom variables Thus inference on 119878119879is based on a joint dis-

tribution no more on a conditional one By employing Gibbssampling techniques Albert and Chib (see [14]) providedan easy to implement algorithm for the Bayesian analysis ofMarkov switching models In particular in their work theparameters of the model and 119878

119905 119905 = 1 119879 are treated as

missing data and they are generated from appropriate con-ditional distributions using Gibbs sampling method As anexample let us consider the following simplemodel with two-state Markov switching mean and variance

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 3: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 3

where the variables 119878119896119905 (119896 119905) isin 1 119872 times 1 119879 are

introduced in order to have a slightly compact equation for120583119878119905

and 120590119878119905

in particular 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905=

0 which implies that under regime 119896 for 119896 isin 1 119872parameters of mean and variance are given by 120583

119896and 120590

119896

Let us underline that in (4) the 119910119905are our observed

data for example historical returns of a stock or some indextime series and we suppose that they are locally distributedas Gaussian random variable in the sense that occasionallyjumps could occur for both the mean 120583

119878119905

and the variance1205902

119878119905

In particular we assume that 1205901

lt 1205902

lt sdot sdot sdot lt 120590119872

and we want to estimate these 119872 unobserved values forstandard deviation as well as the 119872 values for the switchingmean Note that we could also take 120583 as a constant obtainingthe so called switching variance problem or 120590 as a constanthaving a switching mean problem The first one is in generalmore interesting in the analysis of financial time series sincevariance is usually interpreted as an indicator for the marketrsquosvolatility

Given themodel described by (4) the conditional densityof 119910119905given 119878

119905is Gaussian with mean 120583

119878119905

and standarddeviation 120590

119878119905

namely its related probability density functionreads as follow

119891119910119905|119878119905

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905)221205902

119878119905 119909 isin R (5)

andwe are leftwith the problem of estimating both the expec-tations 120583

1 120583

119872and the standard deviations 120590

1 120590

119872

parameters a task that is standard to solve bymaximizing theassociated log-likelihood function lnL defined as follows

lnL =

119879

sum

119905=1

ln (119891119910119905|119878119905

) (6)

A different and more realistic scenario is the one character-ized by unobserved values for 119878

119905 In such a case it could be

possible to consider the MSM-inference problem as a two-step procedure consisting in

(i) estimating the parameters of the model by maximiz-ing the log-likelihood function

(ii) making inferences on the state variable 119878119905 119905 =

1 119879 conditional on the estimates obtained atprevious point

Depending on the amount of information we can useinferencing on 119878

119905 we have

(i) filtered probabilities that refer to inferences about 119878119905

conditional on information up to time 119905 namely withrespect to 120595

119905

(ii) smoothed probabilities that refer to inferences about 119878119905

conditional to the whole sample (history) 120595119879

In what follows we describe a step-by-step algorithmwhich allows us to resolve the filtering problem for a sample ofserially uncorrelated data In particular we slightly generalizethe approach given in [6] assuming that the state variable 119878

119905

belongs to a 4-state space set Ω = 1 2 3 4 at every time119905 = 1 119879 Despite 2-state (expansioncontraction) and 3-state (lowmediumhigh volatility regime) models being theusual choices we decided to consider 4-state MSM in orderto refine the analysis with respect to volatility levels aroundthe mean A finer analysis can be also performed even if onehas to take into account the related nonlinear computationalgrowth We first define the log-likelihood function at time 119905

as

119897 (120579 120595119905) = 119897 (120583

1 120583

119872 1205901 120590

119872 120595119905) (7)

where 120579 = (1205831 120583

119872 1205901 120590

119872) is the vector of parame-

ters that we want to estimate Let us note that the 120579 is updatedat every iteration since we maximize with respect to thefunction 119897(120579 120595

119905) at every stage of our step-by-step procedure

In particular the calibrating procedure reads as follows

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities of the homoge-neous Markov chain underlying the state variablethat is

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 isin Ω (8)

Since in the applications we can only count on returntime series we first have to calibrate with respect tothe transition probabilities 119901

119894119895

(1) choose 4 values 1205902

1lt 1205902

2lt 1205902

3lt 1205902

4(eg

1205901

= 01 1205902

= 02 1205903

= 03 and 1205904

= 04)and a positive arbitrary small constant 120575 gt 0for example 120575 = 001

(2) compute for every 119895 = 1 2 3 4 and for every119905 = 1 119879 the values

119887119895= Φ (119910

119905+ 120575) minus Φ (119910

119905minus 120575)

= int

119910119905+120575

119910119905minus120575

1

radic21205871205902119895

exp[

[

(119909 minus 120583119895)2

21205902119895

]

]

(9)

(3) simulate a value in 1 2 3 4 for 119878119905at each time

from the discrete probability vector

(1198871

sum4

119895=1119887119895

1198872

sum4

119895=1119887119895

1198873

sum4

119895=1119887119895

1198874

sum4

119895=1119887119895

) (10)

(4) set the transition probabilities 119901119894119895just by count-

ing the number of transition from state 119894 to state119895 for 119894 119895 = 1 4 in order to obtain thefollowing transition matrix

119875lowast= (

11990111

11990112

11990113

11990114

11990121

11990122

11990123

11990124

11990131

11990132

11990133

11990134

11990141

11990142

11990143

11990144

) (11)

4 Journal of Mathematics

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (12)

Let us note that by definition if 120587(119905) is a 4 times 1 vectorof steady-state probabilities then 120587(119905 + 1) = 120587(119905) forevery 119905 = 1 119879 moreover 120587(119905 + 1) = 119875

lowast120587(119905)

and (see for example [6 pag 71]) we also have that120587(119905) = (119860

119879119860)minus1119860119879[04

1] where 0

4is a 4 times 1 matrix of

zeros and 119860 = (Id4minus119875lowast

14

) Id4is the four dimensional

identity matrix while 14

= (1 1 1 1) that is thevector of steady-state probabilities is the last columnof the matrix (119860

119879119860)minus1119860119879

Next we perform the following steps for 119905 = 1 119879

Step 1 The probability of 119878119905conditional to information set at

time 119905 minus 1 is given by

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

) 119895 = 1 4

(13)

Step 2 Compute the joint density of 119910119905and 119878119905conditional to

the information set 120595119905minus1

119891 (119910119905 119878119905= 119895 | 120595

119905minus1) = 119891 (119910

119905| 119878119905= 119895 120595

119905minus1)

times P (119878119905= 119895 | 120595

119905minus1) 119895 = 1 4

(14)

The marginal density of 119910119905is given by the sum of the joint

density over all values of 119878119905

119891 (119910119905| 120595119905minus1

) =

4

sum

119894=1

119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1) (15)

Step 3 Update the log-likelihood function at time 119905 in thefollowing way

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (16)

and maximize 119897(120579 120595119905) with respect to 120579 = (120583

1 120583

4 1205901

1205904) under the condition 120590

1lt 1205902lt 1205903lt 1205904 to find the

maximum likelihood estimator 120579 for the next time period

Step 4 Once 119910119905is observed at the end of the 119905th iteration we

can update the probability term

P (119878119905= 119895 | 120595

119905)

=119891 (119910119905119878119905= 119895 120595

119905minus1)P (119878

119905= 119895120595119905minus1

)

sum4

119894=1119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1)

119895 = 1 4

(17)

where both 120595119905= 120595119905minus1

119910119905 and 119891(119910

119905| 119878119905= 119894 120595119905minus1

) are com-puted with respect to the estimator 120579 = (120583

1 120583

4 1

4)

22 Serially Correlated Data In some cases it is possible toargue and mathematically test by for example the Durbin-Watson statistics or Breusch-Godfrey test for the presence ofa serial correlation (or autocorrelation) between data belong-ing to a certain time series of interest Such a characteristicis often analyzed in signal processing scenario but examplescan be also found in economic meteorological or sociolog-ical data sets especially in connection with autocorrelationof errors in related forecasting procedure In particular if wesuppose that the observed variable 119910

119905linearly depends on

its previous value then we obtain a first-order autoregressivepattern and the following state-space model applies

119910119905minus 120583119878119905

= 120601 (119910119905minus1

minus 120583119878119905minus1

) + 120598119905 119905 = 1 2 119879

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205831S1119905

+ sdot sdot sdot + 120583119872119878119872119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 120590119872119878119872119905

119878119905isin 1 119872 with probabilities 119901

119894119895

(18)

where 119901119894119895

= P(119878119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 119872 and 119878

119896119905

and (119896 119905) isin 1 119872 times 1 119879 are the same variablesintroduced in the previous section that is 119878

119896119905= 1 if 119878

119905= 119896

otherwise 119878119896119905

= 0In this situation if the state 119878

119905is known for every 119905 =

1 119879 we need 119878119905and 119878

119905minus1to compute the density of 119910

119905

conditional to past information 120595119905minus1

indeed we have

lnL =

119879

sum

119905=1

ln (119891119910119905|120595119905minus1119878119905119878119905minus1

) (19)

where

119891119910119905|120595119905minus1119878119905119878119905minus1

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905minus120601(119910119905minus1minus120583119878119905minus1))221205902

119878119905 119909 isin R

(20)

If 119878119905are unobserved (and as before we assume that the

state variable can take the four values 1 2 3 4) we apply thefollowing algorithm in order to resolve the filtering problemfor a sample of serially correlated data

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4 (21)

We apply the same trick as before but firstly we haveto estimate the parameter 120601 in order to obtain thisvalue we can use the least square methods (see forexample [7]) that is

120601 =sum119879

119905=1119910119905119910119905+1

sum119879

119905=11199102119905

(22)

Journal of Mathematics 5

Thenwe compute 119911119905= 119910119905minus120601119910119905minus1

for every 119905 = 1 119879

and consider the values 119887119895= Φ(119911

119905+ 120575) minus Φ(119911

119905minus 120575)

(we apply the Normal distribution function to 119911119905+ 120575

instead of 119910119905+ 120575 as done before)

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (23)

taking the last column of the matrix (119860119879119860)minus1119860119879 (see

procedure in Section 21 for details)Next perform the following steps for 119905 = 1 119879

Step 1 Compute the probabilities of 119878119905conditional to infor-

mation set at time 119905 minus 1 for 119895 = 1 4

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

=

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

)

(24)

Step 2 Compute the joint density of 119910119905 119878119905 and 119878

119905minus1given

120595119905minus1

119891 (119910119905 119878119905 119878119905minus1

| 120595119905minus1

) = 119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(25)

where 119891(119910119905

| 119878119905

= 119895 119878119905minus1

= 119894 120595119905minus1

) is given by (20) andP(119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

) is computed in Step 1 The marginaldensity of119910

119905conditional on120595

119905minus1is obtained by summing over

all values of 119878119905and 119878119905minus1

119891 (119910119905| 120595119905minus1

) =

4

sum

119895=1

4

sum

119894=1

119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(26)

Step 3 The log-likelihood function at time 119905 is again

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (27)

and it can be maximized with respect to 120579 = (1205831 120583

4

1205901 120590

4) under condition 120590

1lt 1205902

lt 1205903

lt 1205904 giving the

maximum likelihood estimator 120579 for the next time period

Step 4 Update the joint probabilities of 119878119905and 119878

119905minus1condi-

tional to the new information set 120595119905 using the estimator

120579 computed in Step 3 by maximizing the log-likelihoodfunction 119897(120579 120595

119905)

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905)

=119891 (119910119905 119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

119891 (119910119905| 120595119905minus1

) 119894 119895 = 1 4

(28)

Then compute the updated probabilities of 119878119905given 120595

119905by

summing the joint probabilities over 119878119905minus1

as follows

P (119878119905= 119895 | 120595

119905) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905) forall119895 = 1 4

(29)

The Smoothing Algorithm Once we have run this procedurewe are provided with the filtered probabilities that is thevalues P(119878

119905= 119895 | 120595

119905) for 119895 = 1 4 and for each 119905 = 1 119879

(in addition to the estimator 120579)Sometimes it is required to estimate probabilities of 119878

119905

given the whole sample information that is

P (119878119905= 119895 | 120595

119879) = P (119878

119905= 119895 | 119910

1 119910

119879) forall119895 = 1 4

(30)

which are called smoothed probabilities We are going to showhow these new probabilities can be computed from previousprocedure (the same algorithm although with some obviouschanges can be still used starting from procedure in Section21)

Since the last iteration of the algorithm gives us theprobabilities P(119878

119879= 119895 | 120595

119879) for 119895 = 1 4 we can start

from these values and use the following procedure by doingthe two steps for every 119905 = 119879 minus 1 119879 minus 2 2 1

Step 1 For 119894 119895 = 1 4 compute

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905)

= P (119878119905+1

= 119895 | 120595119879)P (119878119905= 119894 119878119905+1

= 119895 | 120595119905)

P (119878119905+1

= 119895 | 120595119905)

(lowast)

Remark 1 Note that equality (lowast) that is

P (119878119905= 119894 | 119878

119905+1= 119895 120595

119879) = P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905) (31)

holds only under a particular condition namely

119891 (ℎ119905+1119879

| 119878119905+1

= 119895 119878119905= 119894 120595119905) = 119891 (ℎ

119905+1119879| 119878119905+1

= 119895 120595119905)

(32)

where ℎ119905+1119879

= (119910119905+1

119910119879)1015840 (see [6] for the proof) Equa-

tion (32) suggests that if 119878119905+1

were known then 119910119905+1

wouldcontain no information about 119878

119905beyond that contained in

119878119905+1

and 120595119905and does not hold for every state-space model

with regime switching (see for example [6 Ch 5]) in whichcase the smoothing algorithm involves an approximation

Step 2 For 119894 = 1 4 compute

P (119878119905= 119894 | 120595

119879) =

4

sum

119895=1

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879) (33)

3 The Gibbs Sampling Approach

31 An Introduction to Bayesian Inference Under the generaltitle Bayesian inference we can collect a large number ofdifferent concrete procedures nevertheless they are all basedon smart use of the Bayesrsquo rule which is used to update theprobability estimate for a hypothesis as additional evidenceis learned (see for example [8 9]) In particular within

6 Journal of Mathematics

the Bayesian framework the parameters for example let uscollect them in a vector called 120579 which characterize a certainstatistic model and are treated as random variables with theirown probability distributions let us say 119891(120579) which plays therole of a prior distribution since it is defined before taking intoaccount the sample data 119910 Therefore exploiting the Bayesrsquotheorem and denoting by 119891(119910 | 120579) the likelihood of 119910 of theinterested statistic model we have that

119891 (120579 | 119910) =119891 (119910 | 120579) 119891 (120579)

119891 (119910) (34)

where 119891(120579 | 119910) is the joint posterior distribution of theparameters The denominator 119891(119910) defines the marginallikelihood of 119910 and can be taken as a constant obtaining theproportion

119891 (120579 | 119910) prop 119891 (119910 | 120579) 119891 (120579) (35)

It is straightforward to note that the most critical part of theBayesian inference procedure relies in the choice of a suitableprior distribution since it has to agree with parametersconstraints An effective answer to latter issue is given by theso called conjugate prior distribution namely the distributionobtained when the conjugate prior is combined with thelikelihood function Let us note that the posterior distribution119891(120579 | 119910) is in the same family as the prior distribution

As an example if the likelihood function is Gaussianit can be shown that the conjugate prior for the mean 120583 isthe Gaussian distribution whereas the conjugate prior forthe variance is the inverted Gamma distribution (see forexample [9 10])

32 Gibbs Sampling A general problem in Statistics concernsthe question of how a sequence of observations which cannotbe directly sampled can be simulated for example by meanof some multivariate probability distribution with a prefixedprecision degree of accuracy Such kind of problems canbe successfully attacked by Monte Carlo Markov Chain(MCMC) simulation methods see for example [11ndash13] andin particular using the so called Gibbs Sampling techniquewhich allows to approximate joint andmarginal distributionsby sampling from conditional distributions see for example[14ndash16]

Let us suppose that we have the joint density of 119896 randomvariables for example 119891 = 119891(119911

1 1199112 119911

119896) fix 119905 isin 1 119896

and that we are interested in in obtaining characteristics ofthe 119911119905-marginal namely

119891 (119911119905) = int sdot sdot sdot int 119891 (119911

1 1199112 119911

119896) 1198891199111sdot sdot sdot 119889119911119905minus1

119889119911119905+1

sdot sdot sdot 119889119911119896

(36)

such as the relatedmean andor variance In those cases whenthe joint density is not given or the above integral turnsout to be difficult to treat for example an explicit solutiondoes not exist but we know the complete set of conditionaldensities denoted by 119891(119911t | 119911

119895 =119905) 119905 = 1 2 119896 with

119911119895 =119905

= 1199111 119911

119905minus1 119911119905+1

119911119896 then the Gibbs Sampling

method allows us to generate a sample 1199111198951 119911119895

2 119911

119895

119896from the

joint density119891(1199111 1199112 119911

119896)without requiring that we know

either the joint density or the marginal densities With thefollowing procedure we recall the basic ideas on which theGibbs Sampling approach is based given an arbitrary startingset of values (1199110

2 119911

0

119896)

Step 1 Draw 1199111

1from 119891(119911

1| 1199110

2 119911

0

119896)

Step 2 Draw 1199111

2from 119891(119911

2| 1199111

1 1199110

3 119911

0

119896)

Step 3 Draw 1199111

3from 119891(119911

3| 1199111

1 1199111

2 1199110

4 119911

0

119896)

Step k Finally draw 1199111

119896from 119891(119911

119896| 1199111

1 119911

1

119896minus1) to complete

the first iterationThe steps from 1 through 119896 can be iterated 119869 times to get

(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 1 2 119869

In [17] S Geman and D Geman showed that both thejoint and marginal distributions of generated (119911

119895

1 119911119895

2 119911

119895

119896)

converge at an exponential rate to the joint and marginaldistributions of 119911

1 1199112 119911

119896 as 119869 rarr infin Thus the joint

and marginal distributions of 1199111 1199112 119911

119896can be approxi-

mated by the empirical distributions of 119872 simulated values(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 119871 + 1 119871 +119872 where 119871 is large enough

to assure the convergence of the Gibbs sampler Moreover119872can be chosen to reach the required precision with respect tothe empirical distribution of interest

In the MSM framework we do not have conditionaldistributions 119891(119911

119905| 119911119895 =119905

) 119905 = 1 2 119896 and we are left withthe problem of estimate parameters 119911

119894 119894 = 1 119896 Latter

problem can be solved exploiting Bayesian inference resultsas we shall state in the next section

33 Gibbs Sampling for Markov Switching Models A majorproblem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of themodel are dependent on an unobserved variable let us say119878119905 We saw that in the classical framework inference on

Markov switching models consists first in estimating themodelrsquos unknown parameters via maximum likelihood theninference on the unobserved Markov switching variable 119878

119879=

(1198781 1198782 119878

119879) conditional on the parameter estimates has

to be perfomedIn the Bayesian analysis both the parameters of themodel

and the switching variables 119878119905 119905 = 1 119879 are treated as ran-

dom variables Thus inference on 119878119879is based on a joint dis-

tribution no more on a conditional one By employing Gibbssampling techniques Albert and Chib (see [14]) providedan easy to implement algorithm for the Bayesian analysis ofMarkov switching models In particular in their work theparameters of the model and 119878

119905 119905 = 1 119879 are treated as

missing data and they are generated from appropriate con-ditional distributions using Gibbs sampling method As anexample let us consider the following simplemodel with two-state Markov switching mean and variance

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 4: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

4 Journal of Mathematics

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (12)

Let us note that by definition if 120587(119905) is a 4 times 1 vectorof steady-state probabilities then 120587(119905 + 1) = 120587(119905) forevery 119905 = 1 119879 moreover 120587(119905 + 1) = 119875

lowast120587(119905)

and (see for example [6 pag 71]) we also have that120587(119905) = (119860

119879119860)minus1119860119879[04

1] where 0

4is a 4 times 1 matrix of

zeros and 119860 = (Id4minus119875lowast

14

) Id4is the four dimensional

identity matrix while 14

= (1 1 1 1) that is thevector of steady-state probabilities is the last columnof the matrix (119860

119879119860)minus1119860119879

Next we perform the following steps for 119905 = 1 119879

Step 1 The probability of 119878119905conditional to information set at

time 119905 minus 1 is given by

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

) 119895 = 1 4

(13)

Step 2 Compute the joint density of 119910119905and 119878119905conditional to

the information set 120595119905minus1

119891 (119910119905 119878119905= 119895 | 120595

119905minus1) = 119891 (119910

119905| 119878119905= 119895 120595

119905minus1)

times P (119878119905= 119895 | 120595

119905minus1) 119895 = 1 4

(14)

The marginal density of 119910119905is given by the sum of the joint

density over all values of 119878119905

119891 (119910119905| 120595119905minus1

) =

4

sum

119894=1

119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1) (15)

Step 3 Update the log-likelihood function at time 119905 in thefollowing way

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (16)

and maximize 119897(120579 120595119905) with respect to 120579 = (120583

1 120583

4 1205901

1205904) under the condition 120590

1lt 1205902lt 1205903lt 1205904 to find the

maximum likelihood estimator 120579 for the next time period

Step 4 Once 119910119905is observed at the end of the 119905th iteration we

can update the probability term

P (119878119905= 119895 | 120595

119905)

=119891 (119910119905119878119905= 119895 120595

119905minus1)P (119878

119905= 119895120595119905minus1

)

sum4

119894=1119891 (119910119905| 119878119905= 119894 120595119905minus1

)P (119878119905= 119894 | 120595

119905minus1)

119895 = 1 4

(17)

where both 120595119905= 120595119905minus1

119910119905 and 119891(119910

119905| 119878119905= 119894 120595119905minus1

) are com-puted with respect to the estimator 120579 = (120583

1 120583

4 1

4)

22 Serially Correlated Data In some cases it is possible toargue and mathematically test by for example the Durbin-Watson statistics or Breusch-Godfrey test for the presence ofa serial correlation (or autocorrelation) between data belong-ing to a certain time series of interest Such a characteristicis often analyzed in signal processing scenario but examplescan be also found in economic meteorological or sociolog-ical data sets especially in connection with autocorrelationof errors in related forecasting procedure In particular if wesuppose that the observed variable 119910

119905linearly depends on

its previous value then we obtain a first-order autoregressivepattern and the following state-space model applies

119910119905minus 120583119878119905

= 120601 (119910119905minus1

minus 120583119878119905minus1

) + 120598119905 119905 = 1 2 119879

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205831S1119905

+ sdot sdot sdot + 120583119872119878119872119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 120590119872119878119872119905

119878119905isin 1 119872 with probabilities 119901

119894119895

(18)

where 119901119894119895

= P(119878119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 119872 and 119878

119896119905

and (119896 119905) isin 1 119872 times 1 119879 are the same variablesintroduced in the previous section that is 119878

119896119905= 1 if 119878

119905= 119896

otherwise 119878119896119905

= 0In this situation if the state 119878

119905is known for every 119905 =

1 119879 we need 119878119905and 119878

119905minus1to compute the density of 119910

119905

conditional to past information 120595119905minus1

indeed we have

lnL =

119879

sum

119905=1

ln (119891119910119905|120595119905minus1119878119905119878119905minus1

) (19)

where

119891119910119905|120595119905minus1119878119905119878119905minus1

(119909) =1

radic21205871205902119878119905

119890minus(119909minus120583

119878119905minus120601(119910119905minus1minus120583119878119905minus1))221205902

119878119905 119909 isin R

(20)

If 119878119905are unobserved (and as before we assume that the

state variable can take the four values 1 2 3 4) we apply thefollowing algorithm in order to resolve the filtering problemfor a sample of serially correlated data

Inputs

(i) Put 119897(120579) = 119897(120579 1205950) = 0

(ii) Compute the transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4 (21)

We apply the same trick as before but firstly we haveto estimate the parameter 120601 in order to obtain thisvalue we can use the least square methods (see forexample [7]) that is

120601 =sum119879

119905=1119910119905119910119905+1

sum119879

119905=11199102119905

(22)

Journal of Mathematics 5

Thenwe compute 119911119905= 119910119905minus120601119910119905minus1

for every 119905 = 1 119879

and consider the values 119887119895= Φ(119911

119905+ 120575) minus Φ(119911

119905minus 120575)

(we apply the Normal distribution function to 119911119905+ 120575

instead of 119910119905+ 120575 as done before)

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (23)

taking the last column of the matrix (119860119879119860)minus1119860119879 (see

procedure in Section 21 for details)Next perform the following steps for 119905 = 1 119879

Step 1 Compute the probabilities of 119878119905conditional to infor-

mation set at time 119905 minus 1 for 119895 = 1 4

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

=

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

)

(24)

Step 2 Compute the joint density of 119910119905 119878119905 and 119878

119905minus1given

120595119905minus1

119891 (119910119905 119878119905 119878119905minus1

| 120595119905minus1

) = 119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(25)

where 119891(119910119905

| 119878119905

= 119895 119878119905minus1

= 119894 120595119905minus1

) is given by (20) andP(119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

) is computed in Step 1 The marginaldensity of119910

119905conditional on120595

119905minus1is obtained by summing over

all values of 119878119905and 119878119905minus1

119891 (119910119905| 120595119905minus1

) =

4

sum

119895=1

4

sum

119894=1

119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(26)

Step 3 The log-likelihood function at time 119905 is again

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (27)

and it can be maximized with respect to 120579 = (1205831 120583

4

1205901 120590

4) under condition 120590

1lt 1205902

lt 1205903

lt 1205904 giving the

maximum likelihood estimator 120579 for the next time period

Step 4 Update the joint probabilities of 119878119905and 119878

119905minus1condi-

tional to the new information set 120595119905 using the estimator

120579 computed in Step 3 by maximizing the log-likelihoodfunction 119897(120579 120595

119905)

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905)

=119891 (119910119905 119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

119891 (119910119905| 120595119905minus1

) 119894 119895 = 1 4

(28)

Then compute the updated probabilities of 119878119905given 120595

119905by

summing the joint probabilities over 119878119905minus1

as follows

P (119878119905= 119895 | 120595

119905) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905) forall119895 = 1 4

(29)

The Smoothing Algorithm Once we have run this procedurewe are provided with the filtered probabilities that is thevalues P(119878

119905= 119895 | 120595

119905) for 119895 = 1 4 and for each 119905 = 1 119879

(in addition to the estimator 120579)Sometimes it is required to estimate probabilities of 119878

119905

given the whole sample information that is

P (119878119905= 119895 | 120595

119879) = P (119878

119905= 119895 | 119910

1 119910

119879) forall119895 = 1 4

(30)

which are called smoothed probabilities We are going to showhow these new probabilities can be computed from previousprocedure (the same algorithm although with some obviouschanges can be still used starting from procedure in Section21)

Since the last iteration of the algorithm gives us theprobabilities P(119878

119879= 119895 | 120595

119879) for 119895 = 1 4 we can start

from these values and use the following procedure by doingthe two steps for every 119905 = 119879 minus 1 119879 minus 2 2 1

Step 1 For 119894 119895 = 1 4 compute

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905)

= P (119878119905+1

= 119895 | 120595119879)P (119878119905= 119894 119878119905+1

= 119895 | 120595119905)

P (119878119905+1

= 119895 | 120595119905)

(lowast)

Remark 1 Note that equality (lowast) that is

P (119878119905= 119894 | 119878

119905+1= 119895 120595

119879) = P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905) (31)

holds only under a particular condition namely

119891 (ℎ119905+1119879

| 119878119905+1

= 119895 119878119905= 119894 120595119905) = 119891 (ℎ

119905+1119879| 119878119905+1

= 119895 120595119905)

(32)

where ℎ119905+1119879

= (119910119905+1

119910119879)1015840 (see [6] for the proof) Equa-

tion (32) suggests that if 119878119905+1

were known then 119910119905+1

wouldcontain no information about 119878

119905beyond that contained in

119878119905+1

and 120595119905and does not hold for every state-space model

with regime switching (see for example [6 Ch 5]) in whichcase the smoothing algorithm involves an approximation

Step 2 For 119894 = 1 4 compute

P (119878119905= 119894 | 120595

119879) =

4

sum

119895=1

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879) (33)

3 The Gibbs Sampling Approach

31 An Introduction to Bayesian Inference Under the generaltitle Bayesian inference we can collect a large number ofdifferent concrete procedures nevertheless they are all basedon smart use of the Bayesrsquo rule which is used to update theprobability estimate for a hypothesis as additional evidenceis learned (see for example [8 9]) In particular within

6 Journal of Mathematics

the Bayesian framework the parameters for example let uscollect them in a vector called 120579 which characterize a certainstatistic model and are treated as random variables with theirown probability distributions let us say 119891(120579) which plays therole of a prior distribution since it is defined before taking intoaccount the sample data 119910 Therefore exploiting the Bayesrsquotheorem and denoting by 119891(119910 | 120579) the likelihood of 119910 of theinterested statistic model we have that

119891 (120579 | 119910) =119891 (119910 | 120579) 119891 (120579)

119891 (119910) (34)

where 119891(120579 | 119910) is the joint posterior distribution of theparameters The denominator 119891(119910) defines the marginallikelihood of 119910 and can be taken as a constant obtaining theproportion

119891 (120579 | 119910) prop 119891 (119910 | 120579) 119891 (120579) (35)

It is straightforward to note that the most critical part of theBayesian inference procedure relies in the choice of a suitableprior distribution since it has to agree with parametersconstraints An effective answer to latter issue is given by theso called conjugate prior distribution namely the distributionobtained when the conjugate prior is combined with thelikelihood function Let us note that the posterior distribution119891(120579 | 119910) is in the same family as the prior distribution

As an example if the likelihood function is Gaussianit can be shown that the conjugate prior for the mean 120583 isthe Gaussian distribution whereas the conjugate prior forthe variance is the inverted Gamma distribution (see forexample [9 10])

32 Gibbs Sampling A general problem in Statistics concernsthe question of how a sequence of observations which cannotbe directly sampled can be simulated for example by meanof some multivariate probability distribution with a prefixedprecision degree of accuracy Such kind of problems canbe successfully attacked by Monte Carlo Markov Chain(MCMC) simulation methods see for example [11ndash13] andin particular using the so called Gibbs Sampling techniquewhich allows to approximate joint andmarginal distributionsby sampling from conditional distributions see for example[14ndash16]

Let us suppose that we have the joint density of 119896 randomvariables for example 119891 = 119891(119911

1 1199112 119911

119896) fix 119905 isin 1 119896

and that we are interested in in obtaining characteristics ofthe 119911119905-marginal namely

119891 (119911119905) = int sdot sdot sdot int 119891 (119911

1 1199112 119911

119896) 1198891199111sdot sdot sdot 119889119911119905minus1

119889119911119905+1

sdot sdot sdot 119889119911119896

(36)

such as the relatedmean andor variance In those cases whenthe joint density is not given or the above integral turnsout to be difficult to treat for example an explicit solutiondoes not exist but we know the complete set of conditionaldensities denoted by 119891(119911t | 119911

119895 =119905) 119905 = 1 2 119896 with

119911119895 =119905

= 1199111 119911

119905minus1 119911119905+1

119911119896 then the Gibbs Sampling

method allows us to generate a sample 1199111198951 119911119895

2 119911

119895

119896from the

joint density119891(1199111 1199112 119911

119896)without requiring that we know

either the joint density or the marginal densities With thefollowing procedure we recall the basic ideas on which theGibbs Sampling approach is based given an arbitrary startingset of values (1199110

2 119911

0

119896)

Step 1 Draw 1199111

1from 119891(119911

1| 1199110

2 119911

0

119896)

Step 2 Draw 1199111

2from 119891(119911

2| 1199111

1 1199110

3 119911

0

119896)

Step 3 Draw 1199111

3from 119891(119911

3| 1199111

1 1199111

2 1199110

4 119911

0

119896)

Step k Finally draw 1199111

119896from 119891(119911

119896| 1199111

1 119911

1

119896minus1) to complete

the first iterationThe steps from 1 through 119896 can be iterated 119869 times to get

(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 1 2 119869

In [17] S Geman and D Geman showed that both thejoint and marginal distributions of generated (119911

119895

1 119911119895

2 119911

119895

119896)

converge at an exponential rate to the joint and marginaldistributions of 119911

1 1199112 119911

119896 as 119869 rarr infin Thus the joint

and marginal distributions of 1199111 1199112 119911

119896can be approxi-

mated by the empirical distributions of 119872 simulated values(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 119871 + 1 119871 +119872 where 119871 is large enough

to assure the convergence of the Gibbs sampler Moreover119872can be chosen to reach the required precision with respect tothe empirical distribution of interest

In the MSM framework we do not have conditionaldistributions 119891(119911

119905| 119911119895 =119905

) 119905 = 1 2 119896 and we are left withthe problem of estimate parameters 119911

119894 119894 = 1 119896 Latter

problem can be solved exploiting Bayesian inference resultsas we shall state in the next section

33 Gibbs Sampling for Markov Switching Models A majorproblem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of themodel are dependent on an unobserved variable let us say119878119905 We saw that in the classical framework inference on

Markov switching models consists first in estimating themodelrsquos unknown parameters via maximum likelihood theninference on the unobserved Markov switching variable 119878

119879=

(1198781 1198782 119878

119879) conditional on the parameter estimates has

to be perfomedIn the Bayesian analysis both the parameters of themodel

and the switching variables 119878119905 119905 = 1 119879 are treated as ran-

dom variables Thus inference on 119878119879is based on a joint dis-

tribution no more on a conditional one By employing Gibbssampling techniques Albert and Chib (see [14]) providedan easy to implement algorithm for the Bayesian analysis ofMarkov switching models In particular in their work theparameters of the model and 119878

119905 119905 = 1 119879 are treated as

missing data and they are generated from appropriate con-ditional distributions using Gibbs sampling method As anexample let us consider the following simplemodel with two-state Markov switching mean and variance

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 5: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 5

Thenwe compute 119911119905= 119910119905minus120601119910119905minus1

for every 119905 = 1 119879

and consider the values 119887119895= Φ(119911

119905+ 120575) minus Φ(119911

119905minus 120575)

(we apply the Normal distribution function to 119911119905+ 120575

instead of 119910119905+ 120575 as done before)

(iii) Compute the steady-state probabilities

120587 (0) = (P (1198780= 1 | 120595

0) P (119878

0= 4 | 120595

0)) (23)

taking the last column of the matrix (119860119879119860)minus1119860119879 (see

procedure in Section 21 for details)Next perform the following steps for 119905 = 1 119879

Step 1 Compute the probabilities of 119878119905conditional to infor-

mation set at time 119905 minus 1 for 119895 = 1 4

P (119878119905= 119895 | 120595

119905minus1) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

=

4

sum

119894=1

119901119894119895P (119878119905minus1

= 119894 | 120595119905minus1

)

(24)

Step 2 Compute the joint density of 119910119905 119878119905 and 119878

119905minus1given

120595119905minus1

119891 (119910119905 119878119905 119878119905minus1

| 120595119905minus1

) = 119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(25)

where 119891(119910119905

| 119878119905

= 119895 119878119905minus1

= 119894 120595119905minus1

) is given by (20) andP(119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

) is computed in Step 1 The marginaldensity of119910

119905conditional on120595

119905minus1is obtained by summing over

all values of 119878119905and 119878119905minus1

119891 (119910119905| 120595119905minus1

) =

4

sum

119895=1

4

sum

119894=1

119891 (119910119905| 119878119905= 119895 119878119905minus1

= 119894 120595119905minus1

)

times P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

(26)

Step 3 The log-likelihood function at time 119905 is again

119897 (120579 120595119905) = 119897 (120579 120595

119905minus1) + ln (119891 (119910

119905| 120595119905minus1

)) (27)

and it can be maximized with respect to 120579 = (1205831 120583

4

1205901 120590

4) under condition 120590

1lt 1205902

lt 1205903

lt 1205904 giving the

maximum likelihood estimator 120579 for the next time period

Step 4 Update the joint probabilities of 119878119905and 119878

119905minus1condi-

tional to the new information set 120595119905 using the estimator

120579 computed in Step 3 by maximizing the log-likelihoodfunction 119897(120579 120595

119905)

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905)

=119891 (119910119905 119878119905= 119895 119878119905minus1

= 119894 | 120595119905minus1

)

119891 (119910119905| 120595119905minus1

) 119894 119895 = 1 4

(28)

Then compute the updated probabilities of 119878119905given 120595

119905by

summing the joint probabilities over 119878119905minus1

as follows

P (119878119905= 119895 | 120595

119905) =

4

sum

119894=1

P (119878119905= 119895 119878119905minus1

= 119894 | 120595119905) forall119895 = 1 4

(29)

The Smoothing Algorithm Once we have run this procedurewe are provided with the filtered probabilities that is thevalues P(119878

119905= 119895 | 120595

119905) for 119895 = 1 4 and for each 119905 = 1 119879

(in addition to the estimator 120579)Sometimes it is required to estimate probabilities of 119878

119905

given the whole sample information that is

P (119878119905= 119895 | 120595

119879) = P (119878

119905= 119895 | 119910

1 119910

119879) forall119895 = 1 4

(30)

which are called smoothed probabilities We are going to showhow these new probabilities can be computed from previousprocedure (the same algorithm although with some obviouschanges can be still used starting from procedure in Section21)

Since the last iteration of the algorithm gives us theprobabilities P(119878

119879= 119895 | 120595

119879) for 119895 = 1 4 we can start

from these values and use the following procedure by doingthe two steps for every 119905 = 119879 minus 1 119879 minus 2 2 1

Step 1 For 119894 119895 = 1 4 compute

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119879)

= P (119878119905+1

= 119895 | 120595119879)P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905)

= P (119878119905+1

= 119895 | 120595119879)P (119878119905= 119894 119878119905+1

= 119895 | 120595119905)

P (119878119905+1

= 119895 | 120595119905)

(lowast)

Remark 1 Note that equality (lowast) that is

P (119878119905= 119894 | 119878

119905+1= 119895 120595

119879) = P (119878

119905= 119894 | 119878

119905+1= 119895 120595

119905) (31)

holds only under a particular condition namely

119891 (ℎ119905+1119879

| 119878119905+1

= 119895 119878119905= 119894 120595119905) = 119891 (ℎ

119905+1119879| 119878119905+1

= 119895 120595119905)

(32)

where ℎ119905+1119879

= (119910119905+1

119910119879)1015840 (see [6] for the proof) Equa-

tion (32) suggests that if 119878119905+1

were known then 119910119905+1

wouldcontain no information about 119878

119905beyond that contained in

119878119905+1

and 120595119905and does not hold for every state-space model

with regime switching (see for example [6 Ch 5]) in whichcase the smoothing algorithm involves an approximation

Step 2 For 119894 = 1 4 compute

P (119878119905= 119894 | 120595

119879) =

4

sum

119895=1

P (119878119905= 119894 119878119905+1

= 119895 | 120595119879) (33)

3 The Gibbs Sampling Approach

31 An Introduction to Bayesian Inference Under the generaltitle Bayesian inference we can collect a large number ofdifferent concrete procedures nevertheless they are all basedon smart use of the Bayesrsquo rule which is used to update theprobability estimate for a hypothesis as additional evidenceis learned (see for example [8 9]) In particular within

6 Journal of Mathematics

the Bayesian framework the parameters for example let uscollect them in a vector called 120579 which characterize a certainstatistic model and are treated as random variables with theirown probability distributions let us say 119891(120579) which plays therole of a prior distribution since it is defined before taking intoaccount the sample data 119910 Therefore exploiting the Bayesrsquotheorem and denoting by 119891(119910 | 120579) the likelihood of 119910 of theinterested statistic model we have that

119891 (120579 | 119910) =119891 (119910 | 120579) 119891 (120579)

119891 (119910) (34)

where 119891(120579 | 119910) is the joint posterior distribution of theparameters The denominator 119891(119910) defines the marginallikelihood of 119910 and can be taken as a constant obtaining theproportion

119891 (120579 | 119910) prop 119891 (119910 | 120579) 119891 (120579) (35)

It is straightforward to note that the most critical part of theBayesian inference procedure relies in the choice of a suitableprior distribution since it has to agree with parametersconstraints An effective answer to latter issue is given by theso called conjugate prior distribution namely the distributionobtained when the conjugate prior is combined with thelikelihood function Let us note that the posterior distribution119891(120579 | 119910) is in the same family as the prior distribution

As an example if the likelihood function is Gaussianit can be shown that the conjugate prior for the mean 120583 isthe Gaussian distribution whereas the conjugate prior forthe variance is the inverted Gamma distribution (see forexample [9 10])

32 Gibbs Sampling A general problem in Statistics concernsthe question of how a sequence of observations which cannotbe directly sampled can be simulated for example by meanof some multivariate probability distribution with a prefixedprecision degree of accuracy Such kind of problems canbe successfully attacked by Monte Carlo Markov Chain(MCMC) simulation methods see for example [11ndash13] andin particular using the so called Gibbs Sampling techniquewhich allows to approximate joint andmarginal distributionsby sampling from conditional distributions see for example[14ndash16]

Let us suppose that we have the joint density of 119896 randomvariables for example 119891 = 119891(119911

1 1199112 119911

119896) fix 119905 isin 1 119896

and that we are interested in in obtaining characteristics ofthe 119911119905-marginal namely

119891 (119911119905) = int sdot sdot sdot int 119891 (119911

1 1199112 119911

119896) 1198891199111sdot sdot sdot 119889119911119905minus1

119889119911119905+1

sdot sdot sdot 119889119911119896

(36)

such as the relatedmean andor variance In those cases whenthe joint density is not given or the above integral turnsout to be difficult to treat for example an explicit solutiondoes not exist but we know the complete set of conditionaldensities denoted by 119891(119911t | 119911

119895 =119905) 119905 = 1 2 119896 with

119911119895 =119905

= 1199111 119911

119905minus1 119911119905+1

119911119896 then the Gibbs Sampling

method allows us to generate a sample 1199111198951 119911119895

2 119911

119895

119896from the

joint density119891(1199111 1199112 119911

119896)without requiring that we know

either the joint density or the marginal densities With thefollowing procedure we recall the basic ideas on which theGibbs Sampling approach is based given an arbitrary startingset of values (1199110

2 119911

0

119896)

Step 1 Draw 1199111

1from 119891(119911

1| 1199110

2 119911

0

119896)

Step 2 Draw 1199111

2from 119891(119911

2| 1199111

1 1199110

3 119911

0

119896)

Step 3 Draw 1199111

3from 119891(119911

3| 1199111

1 1199111

2 1199110

4 119911

0

119896)

Step k Finally draw 1199111

119896from 119891(119911

119896| 1199111

1 119911

1

119896minus1) to complete

the first iterationThe steps from 1 through 119896 can be iterated 119869 times to get

(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 1 2 119869

In [17] S Geman and D Geman showed that both thejoint and marginal distributions of generated (119911

119895

1 119911119895

2 119911

119895

119896)

converge at an exponential rate to the joint and marginaldistributions of 119911

1 1199112 119911

119896 as 119869 rarr infin Thus the joint

and marginal distributions of 1199111 1199112 119911

119896can be approxi-

mated by the empirical distributions of 119872 simulated values(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 119871 + 1 119871 +119872 where 119871 is large enough

to assure the convergence of the Gibbs sampler Moreover119872can be chosen to reach the required precision with respect tothe empirical distribution of interest

In the MSM framework we do not have conditionaldistributions 119891(119911

119905| 119911119895 =119905

) 119905 = 1 2 119896 and we are left withthe problem of estimate parameters 119911

119894 119894 = 1 119896 Latter

problem can be solved exploiting Bayesian inference resultsas we shall state in the next section

33 Gibbs Sampling for Markov Switching Models A majorproblem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of themodel are dependent on an unobserved variable let us say119878119905 We saw that in the classical framework inference on

Markov switching models consists first in estimating themodelrsquos unknown parameters via maximum likelihood theninference on the unobserved Markov switching variable 119878

119879=

(1198781 1198782 119878

119879) conditional on the parameter estimates has

to be perfomedIn the Bayesian analysis both the parameters of themodel

and the switching variables 119878119905 119905 = 1 119879 are treated as ran-

dom variables Thus inference on 119878119879is based on a joint dis-

tribution no more on a conditional one By employing Gibbssampling techniques Albert and Chib (see [14]) providedan easy to implement algorithm for the Bayesian analysis ofMarkov switching models In particular in their work theparameters of the model and 119878

119905 119905 = 1 119879 are treated as

missing data and they are generated from appropriate con-ditional distributions using Gibbs sampling method As anexample let us consider the following simplemodel with two-state Markov switching mean and variance

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 6: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

6 Journal of Mathematics

the Bayesian framework the parameters for example let uscollect them in a vector called 120579 which characterize a certainstatistic model and are treated as random variables with theirown probability distributions let us say 119891(120579) which plays therole of a prior distribution since it is defined before taking intoaccount the sample data 119910 Therefore exploiting the Bayesrsquotheorem and denoting by 119891(119910 | 120579) the likelihood of 119910 of theinterested statistic model we have that

119891 (120579 | 119910) =119891 (119910 | 120579) 119891 (120579)

119891 (119910) (34)

where 119891(120579 | 119910) is the joint posterior distribution of theparameters The denominator 119891(119910) defines the marginallikelihood of 119910 and can be taken as a constant obtaining theproportion

119891 (120579 | 119910) prop 119891 (119910 | 120579) 119891 (120579) (35)

It is straightforward to note that the most critical part of theBayesian inference procedure relies in the choice of a suitableprior distribution since it has to agree with parametersconstraints An effective answer to latter issue is given by theso called conjugate prior distribution namely the distributionobtained when the conjugate prior is combined with thelikelihood function Let us note that the posterior distribution119891(120579 | 119910) is in the same family as the prior distribution

As an example if the likelihood function is Gaussianit can be shown that the conjugate prior for the mean 120583 isthe Gaussian distribution whereas the conjugate prior forthe variance is the inverted Gamma distribution (see forexample [9 10])

32 Gibbs Sampling A general problem in Statistics concernsthe question of how a sequence of observations which cannotbe directly sampled can be simulated for example by meanof some multivariate probability distribution with a prefixedprecision degree of accuracy Such kind of problems canbe successfully attacked by Monte Carlo Markov Chain(MCMC) simulation methods see for example [11ndash13] andin particular using the so called Gibbs Sampling techniquewhich allows to approximate joint andmarginal distributionsby sampling from conditional distributions see for example[14ndash16]

Let us suppose that we have the joint density of 119896 randomvariables for example 119891 = 119891(119911

1 1199112 119911

119896) fix 119905 isin 1 119896

and that we are interested in in obtaining characteristics ofthe 119911119905-marginal namely

119891 (119911119905) = int sdot sdot sdot int 119891 (119911

1 1199112 119911

119896) 1198891199111sdot sdot sdot 119889119911119905minus1

119889119911119905+1

sdot sdot sdot 119889119911119896

(36)

such as the relatedmean andor variance In those cases whenthe joint density is not given or the above integral turnsout to be difficult to treat for example an explicit solutiondoes not exist but we know the complete set of conditionaldensities denoted by 119891(119911t | 119911

119895 =119905) 119905 = 1 2 119896 with

119911119895 =119905

= 1199111 119911

119905minus1 119911119905+1

119911119896 then the Gibbs Sampling

method allows us to generate a sample 1199111198951 119911119895

2 119911

119895

119896from the

joint density119891(1199111 1199112 119911

119896)without requiring that we know

either the joint density or the marginal densities With thefollowing procedure we recall the basic ideas on which theGibbs Sampling approach is based given an arbitrary startingset of values (1199110

2 119911

0

119896)

Step 1 Draw 1199111

1from 119891(119911

1| 1199110

2 119911

0

119896)

Step 2 Draw 1199111

2from 119891(119911

2| 1199111

1 1199110

3 119911

0

119896)

Step 3 Draw 1199111

3from 119891(119911

3| 1199111

1 1199111

2 1199110

4 119911

0

119896)

Step k Finally draw 1199111

119896from 119891(119911

119896| 1199111

1 119911

1

119896minus1) to complete

the first iterationThe steps from 1 through 119896 can be iterated 119869 times to get

(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 1 2 119869

In [17] S Geman and D Geman showed that both thejoint and marginal distributions of generated (119911

119895

1 119911119895

2 119911

119895

119896)

converge at an exponential rate to the joint and marginaldistributions of 119911

1 1199112 119911

119896 as 119869 rarr infin Thus the joint

and marginal distributions of 1199111 1199112 119911

119896can be approxi-

mated by the empirical distributions of 119872 simulated values(119911119895

1 119911119895

2 119911

119895

119896) 119895 = 119871 + 1 119871 +119872 where 119871 is large enough

to assure the convergence of the Gibbs sampler Moreover119872can be chosen to reach the required precision with respect tothe empirical distribution of interest

In the MSM framework we do not have conditionaldistributions 119891(119911

119905| 119911119895 =119905

) 119905 = 1 2 119896 and we are left withthe problem of estimate parameters 119911

119894 119894 = 1 119896 Latter

problem can be solved exploiting Bayesian inference resultsas we shall state in the next section

33 Gibbs Sampling for Markov Switching Models A majorproblem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of themodel are dependent on an unobserved variable let us say119878119905 We saw that in the classical framework inference on

Markov switching models consists first in estimating themodelrsquos unknown parameters via maximum likelihood theninference on the unobserved Markov switching variable 119878

119879=

(1198781 1198782 119878

119879) conditional on the parameter estimates has

to be perfomedIn the Bayesian analysis both the parameters of themodel

and the switching variables 119878119905 119905 = 1 119879 are treated as ran-

dom variables Thus inference on 119878119879is based on a joint dis-

tribution no more on a conditional one By employing Gibbssampling techniques Albert and Chib (see [14]) providedan easy to implement algorithm for the Bayesian analysis ofMarkov switching models In particular in their work theparameters of the model and 119878

119905 119905 = 1 119879 are treated as

missing data and they are generated from appropriate con-ditional distributions using Gibbs sampling method As anexample let us consider the following simplemodel with two-state Markov switching mean and variance

119910119905= 120583119878119905

+ 120598119905 119905 = 1 2 119879

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 7: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 7

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 1205830+ 1205831119878119905

120590119878119905

= 1205902

0(1 minus 119878

119905) + 1205902

1119878119905= 1205902

0(1 + ℎ

1119878119905) ℎ

1gt 0

(37)

where 119878119905isin 0 1 with transition probabilities 119901 = P(119878

119905= 0 |

119878119905minus1

= 0) 119902 = P(119878119905= 1 | 119878

119905minus1= 1) The Bayesian method

consider both 119878119905 119905 = 1 119879 and themodelrsquos unknown para-

meters 1205830 1205831 1205900 1205901 119901 and 119902 as random variables In order

to make inference about these 119879 + 6 variables we need toderive the joint posterior density 119891(119878

119879 1205830 1205831 1205902

0 1205902

1 119901 119902 |

120595119879) where 120595

119879= (1199101 1199102 119910

119879) and 119878

119879= (1198781 1198782 119878

119879)

Namely the realization of the Gibbs sampling relies on thederivation of the distributions of each of the above 119879 + 6

variables conditional on all the other variables Therefore wecan approximate the joint posterior density written above byrunning the following procedure 119871 + 119872 times where 119871 is aninteger large enough to guarantee the desired convergenceHence we have the following scheme

Step 1 We can derive the distribution of 119878119905 119905 = 1 119879 con-

ditional on the other parameters in two different ways

(1) Single-move gibbs sampling generate each 119878119905from

119891(119878119905| 119878=119905 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) 119905 = 1 119879 where

119878=119905= (1198781 119878

119905minus1 119878119905+1

119878119879)

(2) Multi-move gibbs sampling generate the whole block119878119879from 119891(119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879)

Step 2 Generate the transition probabilities 119901 and 119902 from119891(119901 119902 | 119878

119879) Note that this distribution is conditioned only

on 119878119879because we assume that 119901 and 119902 are independent of

both the other parameters of the model and the data 120595119879

If we choose the Beta distribution as prior distribution forboth 119901 and 119902 we have that posterior distribution 119891(119901 119902 |

119878119879) = 119891(119901 119902)119871(119901 119902 | 119878

119879) is again a Beta distribution So

Beta distribution is a conjugate prior for the likelihood oftransition probabilities

Step 3 Generate 1205830and 120583

1from 119891(120583

0 1205831

| 119878119879 1205902

0 1205902

1 119901 119902

120595119879) In this case the conjugate prior is theNormal distribution

Step 4 Generate 1205902

0and 120590

2

1from 119891(120590

2

0 1205902

1| 119878119879 1205830 1205831 119901 119902

120595119879) From definition of the model we have that 1205902

1= 1205902

0(1 +

ℎ1) we can first generate 120590

2

0conditional on ℎ

1 and then

generate ℎ1= 1 + ℎ

1conditional on 120590

2

0 We use in both cases

the Inverted Gamma distribution as conjugate prior for theparameters

For a more detailed description of these steps (see [6pp 211ndash218]) Here we examine only the so called Multi-move Gibbs sampling originally motivated by Carter andKohn (see [15]) in the context of state space models and thenimplemented in [6] for a MSM For the sake of simplicity

let us suppress the conditioning on modelrsquos parameters anddenote

119891 (119878119879| 120595119879) = 119891 (119878

119879| 1205830 1205831 1205902

0 1205902

1 119901 119902 120595

119879) (38)

Using the Markov property of 119878119905119905isin1119879

it can be seenthat

119891 (119878119879| 120595119879) = 119891 (119878

119879| 120595119879)

119879minus1

prod

119905=1

119891 (119878119905| 119878119905+1

120595119905) (39)

where 119891(119878119879

| 120595119879) = P(119878

119879| 120595119879) is provided by the last

iteration of filtering algorithm (see Sections 21 and 22) Notethat (39) suggests that we can first generate 119878

119879conditional on

120595119879and then for 119905 = 119879 minus 1 119879 minus 2 1 we can generate 119878

119905

conditional on 120595119905and 119878119905+1

namely we can run the followingsteps

Step 1 Run the basic filter procedure to get 119891(119878119905| 120595119905) 119905 =

1 2 119879 and save them the last iteration of the filter givesus the probability distribution 119891(119878

119879| 120595119879) from which 119878

119879is

generated

Step 2 Note that

119891 (119878119905| 119878119905+1

120595119905)

=119891 (119878119905 119878119905+1

| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905 120595119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

=119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

119891 (119878119905+1

| 120595119905)

prop 119891 (119878119905+1

| 119878119905) 119891 (119878119905| 120595119905)

(40)

where 119891(119878119905+1

| 119878119905) is the transition probability and 119891(119878

119905| 120595119905)

has been saved from Step 1 So we can generate 119878119905in the

following way first calculate

P (119878119905= 1 | 119878

119905+1 120595119905)

=119891 (119878119905+1

| 119878119905= 1) 119891 (119878

119905= 1 | 120595

119905)

sum1

119895=0119891 (119878119905+1

| 119878119905= 119895) 119891 (119878

119905= 119895 | 120595

119905)

(41)

and then generate 119878119905using a uniform distribution For exam-

ple we generate a random number from a uniform distri-bution between 0 and 1 if this number is less than or equalto the calculated value of P(119878

119905= 1 | 119878

119905+1 120595119905) we set 119878

119905= 1

otherwise 119878119905is set equal to 0

In view of applications let us now consider the followingfour state MSM

119910119905sim N (0 120590

2

119878119905

) 119905 = 1 2 119879

120590119878119905

= 12059011198781119905

+ 12059021198782119905

+ 12059031198783119905

+ 12059041198784119905

119878119905isin 1 2 3 4 with transition probabilities

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894) 119894 119895 = 1 2 3 4

(42)

where 119878119896119905

= 1 if 119878119905= 119896 otherwise 119878

119896119905= 0 Note that this is

a particular case of the model analysed in Section 21 where

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 8: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

8 Journal of Mathematics

120583119905= 0 forall119905 hence we can perform the procedure referred to

serially uncorrelated data taking120583119878119905

= 120583 = 0 to start theGibbssampling algorithm therefore we have

Step 1 Generate 119878119879

= (1198781 1198782 119878

119879) conditional on

2=

(1205902

1 1205902

2 1205902

3 1205902

4)

119901 = (11990111 11990112 11990113 11990121 11990122 11990123 11990131 11990132 11990133 11990141 11990142 11990143)

120595119879= (1199101 1199102 119910

119879)

(43)

For this purpose we employ the Multi-move Gibbs sam-pling algorithm

(1) run procedure in Section 21 with 120583119878119905

= 0 in order toget from last iteration 119891(119878

119879| 120595119879) = P(119878

119879| 120595119879)

(2) recalling that 119891(119878119905| 119878119905+1

120595119905) prop 119891(119878

119905+1| 119878119905)119891(119878119905| 120595119905)

for 119905 = 119879minus1 1 we can generate 119878119905from the vector

of probabilities

(P (119878119905= 1 | 119878

119905+1 120595119905) P (119878

119905= 2 | 119878

119905+1 120595119905)

P (119878119905= 3 | 119878

119905+1 120595119905) P (119878

119905= 4 | 119878

119905+1 120595119905))

(44)

where for 119894 = 1 4

P (119878119905= 119894119878119905+1

120595119905) =

119891 (119878119905+1

119878119905= 1) 119891 (119878

119905= 119894120595119905)

sum3

119895=1119891 (119878119905+1

119878119905= 119895) 119891 (119878

119905= 119895120595119905)

(45)

Step 2 Generate 2 conditional on 119878

119879and the data 120595

119879

We want to impose the constraint 12059021lt 1205902

2lt 1205902

3lt 1205902

4 so

we redefine 1205902

119878119905

in this way

1205902

119878119905

= 1205902

1(1 + 119878

2119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3)

times (1 + 1198784119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(46)

where ℎ119895gt 0 for 119895 = 1 4 so that 1205902

2= 1205902

1(1 + ℎ

2) 12059023=

1205902

1(1+ℎ2)(1+ℎ

3) and 120590

2

4= 1205902

1(1+ℎ2)(1+ℎ

3)(1+ℎ

4)With this

specification we first generate 1205902

1 then generate ℎ

2= 1 + ℎ

2

ℎ3

= 1 + ℎ3and ℎ

4= 1 + ℎ

4to obtain 120590

2

2 12059023and 120590

2

4indi-

rectly

Generating 1205902

1 Conditional on ℎ

2 ℎ3and ℎ

4 Define for 119905 =

1 119879

1198841

119905=

119910119905

radic(1 + 1198782119905ℎ2) (1 + 119878

3119905ℎ2) (1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(47)

and take 1198841119905

sim N(0 1205902

1) in (42) By choosing an inverted

Gamma prior distribution that is 119891(1205902

1| ℎ2 ℎ3 ℎ4) sim IG(]

1

2 12057512) where ]

1 1205751are the known prior hyperparameters it

can be shown that the conditional posterior distribution fromwhich we generate 120590

2

1is given by

1205902

1| 120595119879 119878119879 ℎ2 ℎ3 ℎ4sim IG(

]1+ 119879

21205751+ sum119879

119905=11198841

119905

2) (48)

Generating ℎ2Conditional on 120590

2

1 ℎ3and ℎ

4 Note that the

likelihood function of ℎ2depends only on the values of 119910

119905for

which 119878119905isin 2 3 4 Therefore take 119910

(1)

119905= 119910119905| 119878119905isin 2 3

4 119905 = 1 119879 and denote with 1198792the size of this sample

Then define

1198842

119905=

119910(1)

119905

radic12059021(1 + 119878

3119905ℎ3) (1 + 119878

4119905ℎ3) (1 + 119878

4119905ℎ4)

(49)

hence for the observation in which 119878119905= 2 3 or 4 we have

1198842119905

sim N(0 ℎ2) If we choose an inverted Gamma distribution

with parameters ]2 1205752for the prior we obtain ℎ

2= 1 + ℎ

2

from the following posterior distribution

ℎ2| 120595119879 119878119879 1205902

1 ℎ3 ℎ4sim IG(

]2+ 1198792

21205752+ sum1198792

119905=11198842

119905

2) (50)

In case ℎ2gt 1 put ℎ

2= ℎ2minus1 and 120590

2

2= 1205902

1(1+ℎ2) Otherwise

reiterate this step

Generating ℎ3Conditional on 120590

2

1 ℎ2and ℎ

4 Operate in a

similar way as above In particular if we define 119910(2)

119905= 119910119905|

119878119905isin 3 4 119905 = 1 119879 we will obtain

1198843

119905=

119910(2)

119905

radic12059021(1 + 119878

3119905ℎ2) (1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ4)

sim N (0 ℎ3)

(51)

Generating ℎ4Conditional on 120590

2

1 ℎ2and ℎ

3 Operate in a

similar way as above In particular if we define 119910(3)

119905= 119910119905|

119878119905= 4 119905 = 1 119879 we will have

1198844

119905=

119910(3)

119905

radic12059021(1 + 119878

4119905ℎ2) (1 + 119878

4119905ℎ3)

sim N (0 ℎ4) (52)

Step 3 Generate 119901 conditional on 119878119879 In order to generate the

transition probabilities we exploit the properties of the priorBeta distribution Let us first define

119901119894119894= P (119878

119905= 119894 | 119878119905minus1

= 119894) = 1 minus 119901119894119894 119894 = 1 2 3 4

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894) 119894 = 119895

(53)

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 9: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 9

Hence we have that

119901119894119895= P (119878

119905= 119895 | 119878

119905minus1= 119894)

= P (119878119905= 119895 | 119878

119905minus1= 119894 119878119905

= 119894)P (119878119905

= 119894 | 119878119905minus1

= 119894)

= 119901119894119895(1 minus 119901

119894119894) forall119894 = 119895

(54)

Given 119878119879 let 119899

119894119895 119894 119895 = 1 2 3 4 be the total number of tran-

sitions from state 119878119905minus1

= 119894 to 119878119905= 119895 119905 = 2 3 119879 and 119899

119894119895the

number of transitions from state 119878119905minus1

= 119894 to 119878119905

= 119895Begin with the generation of probabilities119901

119894119894 119894 = 1 2 3 4

by taking the Beta distribution as conjugate prior if we take119901119894119894sim Beta(119906

119894119894 119906119894119894) where119906

119894119894and119906119894119894are the knownhyperpara-

meters of the priors the posterior distribution of 119901119894119894given 119878

119879

still belongs to the Beta family distributions that is

119901119894119894| 119878119879sim Beta (119906

119894119894+ 119899119894119894 119906119894119894+ 119899119894119894) 119894 = 1 2 3 4 (55)

The others parameters that is 119901119894119895for 119894 = 119895 and 119895 = 1 2 3

can be computed from the above equation 119901119894119895

= 119901119894119895(1 minus 119901

119894119894)

where 119901119894119895are generated from the following posterior Beta

distribution

119901119894119895| 119878119879sim Beta (119906

119894119895+ 119899119894119895 119906119894119895+ 119899119894119895) (56)

For example given that 11990111

is generated we can obtain 11990112

and 11990113by considering

11990112

| 119878119879sim Beta (119906

12+ 11989912 11990612

+ 11989912)

11990113

| 119878119879sim Beta (119906

13+ 11989913 11990613

+ 11989913)

(57)

where 11989912

= 11989913+11989914and 11989913

= 11989912+11989914 Finally given119901

1111990112

and11990113generated in this way we have119901

14= 1minus119901

11minus11990112minus11990113

Remark 2 When we do not have any information aboutpriors distribution we employ hyperparameters 119906

119894119895= 05

119894 119895 = 1 2 3 4 Usually we know that elements of the matrixdiagonal in the transition matrix are bigger than elementsout of the diagonal because in a financial framework regimeswitching happens only occasionally in this case since wewant 119901

119894119894close to 1 and 119901

119894119895 119894 = 119895 close to 0 we will choose

119906119894119894bigger than 119906

119894119894

4 Goodness of Fit

Since financial time series are characterized by complex andrather unpredictable behavior it is difficult to find if thereis any a possible pattern A typical set of techniques whichallow tomeasure the goodness of forecasts obtained by using acertainmodel is given by the residual analysis Let us supposethat we are provided with a time series of return observations119910119905119905=1119879

119879 isin N+ for which we choose for example themodel described in (4)with119872 = 4 By running the procedureof Section 21 we obtain the filtered probabilities

P (119878119905= 119895 | 120595

119905) 119895 = 1 2 3 4 119905 = 1 119879 (58)

and by maximization of the log-likelihood function wecompute the parameters 120583

1 120583

4 1

4 therefore we

can estimate both the mean and variance of the process attime 119905 for any 119905 = 1 119879 given the information set 120595

119905as

weighted average of four values

120583119905= E (120583

119905| 120595119905) = 120583

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 1205834P (119878119905= 4 | 120595

119905)

2

119905= E (120590

2

119905| 120595119905) =

2

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 2

4P (119878119905= 4 | 120595

119905)

(59)

If the chosen model fits well the data then the standardizedresiduals will have the following form

120598119905=

119910119905minus 120583119905

119905

sim N (0 1) 119905 = 1 119879 (60)

therefore it is natural to apply a normality test as for examplethe Jarque-Bera test (see [18]) for detailsWe recall briefly thatJarque-Bera statistics is defined as

JB =119879

6(1198782minus

1

4(119870 minus 3)

2) (61)

where the parameters 119878 and119870 indicate the skewness respec-tively the kurtosis of 120598

119905 If 120598119905come from a Normal distribu-

tion the Jarque-Bera statistics converges asymptotically to achi-squared distribution with two degrees of freedom andcan be used to test the null hypothesis of normality this isa joint hypothesis of the skewness being zero and the excesskurtosis (119870 minus 3) being also zero

Remark 3 Note that the Jarque-Bera test is very sensitiveand often rejects the null hypothesis only because of a fewabnormal observations this is the reason why one has to takepoint out these outliers which has to be canceled out beforeapply the test on the obtained smoothed data

5 Prediction

The forecasting task is the most difficult step in the wholeMSM approach Let us suppose that our time series ends attime 119879 isin N+ without further observations then we have tostart the prediction with the following quantities

(i) the transition probability matrix 119875lowast= 119901119894119895119894119895=1234

(ii) the vector 120587

119879= P(119878

119879| 120595119879) = (P(119878

119879= 1 |

120595119879) P(119878

119879= 4 | 120595

119879)) obtained from the last

iteration of the filter algorithm for example theprocedure in Section 21

It follows that we have to proceed with the first step of thefilter procedure obtaining the one-step ahead probability ofthe state 119878

119879+1given the sample of observations 120595

119879 that is

P (119878119879+1

= 119895 | 120595119879) =

4

sum

119894=1

119901119894119895P (119878119879= 119895 | 120595

119879) 119895 = 1 2 3 4

(62)

Equation (62) can be seen as a prediction for the regimeat time 119879 + 1 knowing observations up to time 119879 At this

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 10: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

10 Journal of Mathematics

point the best way to make prediction about the unobservedvariable is the simulation of further observations Indeedwith the new probability P(119878

119879+1| 120595119879) and the vector of

parameter estimates 120579 = (1205831 120583

4 1

4) we can

estimate the one step ahead mean and variance as follows

120583119879+1

= E (120583119879+1

| 120595119879)

= 1205831P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot + 120583

4P (119878119879+1

= 4 | 120595119879)

2

119879+1= E (120590

2

119879+1| 120595119879)

= 2

1P (119878119879+1

= 1 | 120595119879) + sdot sdot sdot +

2

4P (119878119879+1

= 4 | 120595119879)

(63)

Then we simulate 119910119879+1

by the Gaussian distributionN(120583119879+1

119879+1

) and once 119910119879+1

has been simulated we defe 120595119879+1

=

1199101 119910

119879 119910119879+1

Then we first apply again the filter proce-dure of Section 21 for 119905 = 119879 + 1 in order to obtain P(119878

119879+1|

120595119879+1

) then we compute P(119878119879+1

| 120595119879+1

) 120583119879+2

and 2

119879+2 and

we simulate 119910119879+2

by the Gaussian distributionN(120583119879+2

119879+2

)Latter procedure runs the same all the other rime-steps 119879 +

3 119879+119898 where119898 isin N+ is the time horizon of our forecast

Remark 4 We would like to underline that latter describedmethod is not reliable with few simulations since each 119910

119879+120591

for 120591 = 1 119898 may assume a wide range of values and asingle drawn describes only one of the many possible pathsSo we can think to reiterate previous strategy many timesin order to compute the mean behavior of P(119878

119879+120591| 120595119879+120591

)120583119879+120591

and 119879+120591

After having obtained a satisfactory number ofdata then we can construct a confidence interval within thestate probability will more likely take value Obviously a highnumber of iterations of latter procedure rapidly increases thecomputational complexity of the whole algorithm because ofthe MLE related computational complexity therefore we willadopt a rather different strategy which consists in simulating119910119879+120591

119873 times at each step (eg 119873 = 10000) and thentaking the mean over those values However we must payattention because the mean calculation could cancel thepossible regime switching for example if we draw manytimes 119910

119905from N(0 120590

119878119905

) and we take the mean by the lawof large number we will have zero at any time To overcomethis problem we can take the mean of absolute values andthen multiply this mean by a number 119909 which is a randomvariable that takes values 1 orminus1 with equal probability hencedeciding the sign of 119910

119905at every simulation step

6 Applications

In this section we are going to apply the classical inferenceapproach for a MSM to analyse real financial time seriesIn particular we will first examine data coming from theStandard amp Poorrsquos 500 (SampP 500) equity index which is con-sidered being based on the 500most important companies intheUnited States as one of the best representations of theUSstockmarket Secondly we shall consider theDAX (DeutscheAktien Index) index which follows the quotations of the 30major companies in Germany Our choice is motivated by

a twofold goal first we want to test the proposed 4-statesMSM model on two particularly significant indexes whichhave shown to incorporate abrupt changes and oscillationssecondly we aim at comparing the behaviour of the twoindexes between each other

Computations have been performed following the MSMapproach described in previous section namely exploitingthe procedures illustrated in Section 2 Let us underline thatinstead of a standard 3-states MSM model we shall use a 4-states MSM approach both for the SampP 500 and the DAXreturns Moreover the analysis has been realized for differentintervals of time focusing mainly on the period of GlobalFinancial Crisis

61 The SampP 500 Case Figure 1 reports the graph of theStandard amp Poorrsquos 500 from 1st June 1994 to 27th May2014 and it points out the dramatic collapse of index pricesin years 2008-2009 when the crisis blowed-up causing theachievement 6th of March 2009 with 68338 points of thelowest value since September 1996

Because of the latter fact we decided to focus our analysison recent years In particular we take into account datastarting from the 1st of June 2007 and until 27 May 2014therefore denoting with Λ the set of observations and with119883119905 119905 isin Λ the price data of the SampP 500 returns are calculated

as usual by 119910119905

= (119883119905minus 119883119905minus1

)119883119905minus1

119905 isin Λ where 119910119905119905isinΛ

are the values for which we want to choose the best MSMNote that in our implementation we grouped the daily datainto weekly parcels in order to make the filter procedures lesstime-consuming and have a more clear output therefore weobtain a vector of 365 values still denoted by 119910

119905 as shown in

Figure 2Next step consists in understand if the returns are serially

correlated or serially uncorrellated a taks which can beaccomplished by running some suitable test for example theDurbin-Watson test (see for example [19 20] or [7]) com-puting directly the value of the autoregressive parameter 120601 byleast square methods namely 120601 = (sum

119905isinΛ119910119905119910119905+1

)(sum119905isinΛ

1199102

119905)

which gives us a rather low value that is minus00697 so that wecan neglect the autoregressive pattern and start the analysisby considering SampP 500 returns to be generated by aGaussiandistribution with switching mean and variance that is

119910119905= 120583119878119905

+ 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120583119878119905

= 12058311198781119905

+ sdot sdot sdot + 12058341198784119905

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(64)

where for (119896 119905) isin 1 4 times Λ we have 119878119896119905

= 1 if 119878119905

=

119896 otherwise 119878119896119905

= 0 Therefore we suppose that the statevariable 119878

119905 119905 isin Λ takes its values in the set Ω = 1 2 3 4

and we expect that the probabilities of being in the third andfourth state increase as a financial crisis occurs Exploiting theprocedure provided in Section 21 with respect to the returns

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 11: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 11

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-2014400600800

100012001400160018002000

SampP500

Figure 1 Daily observations of SampP 500 from 1994 to 2014

07-Jun-2007 04-Oct-2009 01-Feb-2012 31-May-2014

0

005

01

015

Weekly returns SampP500

minus02

minus015

minus01

minus005

Figure 2 Daily returns of SampP 500 from 2007 to 2014

119910119905 119905 isin Λ = 1 365 we get the results shown in Figures 3

and 4Let us now consider the estimated standard deviation

119905= E (120590

119905| 120595119905) =

1P (119878119905= 1 | 120595

119905)

+ sdot sdot sdot + 4P (119878119905= 4 | 120595

119905) 119905 isin Λ

(65)

which we want to compare with the VIX index also knownas the Chicago Board Options Exchange (CBOE) marketvolatility index namely one of the most relevant measure forthe implied volatility of the SampP 500 index whose value usedby our analysis are reported in Figure 5

What we obtain by plotting both estimated volatility andVIX values in the same graph can be seen in Figure 6 wherethe VIX trend is plotted in red while we have used the bluecolor for the conditional standard deviation values

Note that in order to have values of the same order each119905 119905 isin Λ has been multiplied by a scale factor equal to

1000 We would like to point out how the estimated standarddeviation accurately approximates the VIX behaviour henceallow us to count on an effective substitute for the volatility ofthe SampP 500 at least during a relative nonchaotic period Infact we also underline that the greater discrepancies betweenreal and simulated values appears during the maximumintensity period of the recent financial crisis In particular thewidest gaps are realized in correspondence with the recessionexperienced at the end of 2008

In what follows we study how latter evidence influencesthe global goodness of the realized analysis In particularwe performed a goodness of fit analysis computing thestandardized residuals of the proposed MSM by 120598

119905= (119910119905minus

120583119905)119905 119905 isin Λ where 119910

119905is the observation of SampP 500 return

at time 119905 120583119905is the estimated conditional mean and

119905is the

standard deviation If the model is a good fit for the SampP 500return standardized residuals will be generated by a standardGaussian distribution In Figures 7 and 8 we have reportedboth the histogram its related graph and the so called normalprobability plot (NPP) for the standardized residuals

Let us recall that the purpose of the NPP is to graphicallyassess whether the residuals could come from a normaldistribution Indeed if such a hypothesis holds then theNPPhas to be linear namely the large majority of the computedvalues that is the blue points in Figure 8 should stay closeto a particular line which is the red dotted one in Figure 8which is the case in our analysis apart from the three pointsin the left-hand corner of the graph which correspond to theminimal values of the vector of standardized residuals

Applying two normality tests on 120598119905119905isinΛ

that is theJarque-Bera test and (see for example [21 pag 443]) theLilliefors test we have that the null hypothesis of normalityfor the standardized residuals can be rejected at the 5 levelunless the previous pointed out outliers are removed Indeedif the two minimal standardized residuals correspondingto 12059871

= minus38441 and 120598153

= minus36469 are cancelled outfrom the vector 120598

119905119905isinΛ

previously cited tests indicate that the

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 12: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

12 Journal of Mathematics

050 100 150 200 250 300 350 4000

State 1

0 50 100 150 200 250 300 350 4000

State 2

0 50 100 150 200 250 300 350 4000

001002003004005006007008009

State 3

0 50 100 150 200 250 300 350 4000

010203040506070809

1

010203040506070809

1

010203040506070809

1

State 4

Figure 3 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400

0 50 100 150 200 250 300 350 4000

005

015

025

035

0 50 100 150 200 250 300 350 4000

State 1 State 2

State 3

01

0102

02

03

03

040506070809

1

0010203040506070809

1

0010203040506070809

1

State 4

Figure 4 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 13: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 13

17-May-1994 19-Jan-2001 24-Sep-2007 29-May-20140

102030405060708090

VIX

Figure 5 CBOE volatility index (VIX) daily data from 1994 to 2014

0 50 100 150 200 250 300 350 40010

20

30

40

50

60

70

80

VIX indexEstimated volatility

Figure 6 VIX index (red) versus estimated volatility (blue)

0 50 100 150 200 250 300 350 400

01234

Standardized residuals

minus1

minus1

minus2

minus2

minus3

minus3

minus4

minus4 0 1 2 3 40

20

40

60

80

100

120

Figure 7 Plot and histogram of standardized residuals

hypothesis of normality at the same significance level of 5cannot be rejected In particular the Jarque-Bera statisticsvalue is JB = 27858 with corresponding 119875-value 119875JB =

02153 and the critical value for this test that is the max-imum value of the JB statistics for which the null hypothesiscannot be rejected at the chosen significance level is equalto 119896JB = 58085 Similarly with regard to the Lilliefors testnumerical value of Liellifors statistics 119875-value and criticalvalue are respectively given by 119871 = 00424 119875

119871= 01181 and

119896119871= 00472In what follows we develop the forecast procedure shown

in Section 5 Since we are dealing with weekly data let us

suppose we want to predict probability of volatility 119905 119905 isin Λ

on a time horizon of two months hence 8 steps ahead thensimulations have been performed according to Remark 4with 119873 = 15000 119879 = 365 120591 = 1 2 8 and 119909 uniformlydistributed in minus1 1 Obtained forecasting results are shownin Figure 9 where plots are referred to the observations fromthe 300th to the 373rd with the last 8 simulated values withinred rectangles

62 The DAX Case In what follows the proposed 4-stateMSM shall be applied to analyse the Deutsche Aktien Index(DAX) stock index during a shorter compared to the study

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 14: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

14 Journal of Mathematics

0 1 2 300010003

001002005010025050075090095098099

09970999

Data

Prob

abili

ty

Normal probability plot

minus1minus2minus3minus4

Figure 8 Normal probability plot of standardized residuals

0 10 20 30 40 50 60 70 80

0

001

002

003

Forecasted returns

minus001

minus002

minus003

(a)

0 10 20 30 40 50 60 70 800015600158

001600162001640016600168

001700172

Forecasted volatility

(b)

Figure 9 Forecast for returns (a) and conditional standard deviation (b)

09-Jan-2008 06-Jan-2009 04-Jan-2010 02-Jan-2011

0005

01015

02

Weekly returns DAX

minus02

minus025

minus015

minus01

minus005

Figure 10 Weekly returns of DAX from 1st January 2008 to 1st January 2011

made in Section 61 time interval indeed we take intoaccount data between the 1st of January 2008 and until the1st of January 2011 Such a choice is motivated by the will ofconcentrate our attention on the most unstable period thatfor the DAX index starts with the abrupt fall experienced bythe Europeanmarkets at the beginning of 2008We underlinethat with respect to the considered time period the estimatedautoregressive coefficient for the DAX index is a bit higher inabsolute value than the one obtained for the SampP 500 indexindeed 120601DAX = minus01477 versus 120601SampP500 = minus00697 so that wedecided to fit the weekly DAX returns with an autoregressive

pattern using the procedure in Section 22 and according tothe following MSM

119910119905= 120601 (119910

119905minus1) + 120598119905 119905 isin Λ

120598119905119905isin1119879

are iid N (0 1205902

119878119905

)

120590119878119905

= 12059011198781119905

+ sdot sdot sdot + 12059041198784119905

119878119905isin 1 4 with probabilities 119901

119894119895

(66)

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 15: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 15

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

005

015

025

035

0 20 40 60 80 100 120 140 1600

005

015

025

035

045

0 20 40 60 80 100 120 140 160

0

State 1 State 2

State 3

010203040506070809

1

001

01 02

02

03

03

04

04

0506070809

1

State 4

01

02

03

Figure 11 Filtered probabilities P(119878119905= 119896 | 120595

119905) for 119905 isin Λ 119896 isin 1 2 3 4

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160

0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 1600

State 1 State 2

State 3

010203040506070809

1

001020304050607

0

01

02

03

04

05

06

07

001020304050607

08

08

091

State 4

Figure 12 Smoothed probabilities P(119878119905= 119896 | 120595

119879) for 119905 isin Λ 119896 isin 1 2 3 4

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 16: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

16 Journal of Mathematics

0 20 40 60 80 100 120 140 160002

003

004

005

006

007

008

009

Conditional standard deviation

Figure 13 Estimated conditional standard deviation for DAX index

minus8 minus6 minus4 minus2 0 20003

001002005010025050075090095098099

0997

Data

Prob

abili

ty

Normal probability plot

Figure 14 Normal probability plot for standardized residuals

where Λ = 1 2 156 is the set of times 119910119905is the return

of DAX index at time 119905 and for (119896 119905) isin 1 4 times Λ we have119878119896119905

= 1 if S119905= 119896 otherwise 119878

119896119905= 0 Note that we have slightly

simplified the model keeping 120583119878119905

= 0 that is we are dealingwith a switching variance model where only 120590

119878119905

switches inregime The latter is not a restriction since we are interestedin model the DAX index volatility In Figure 10 we report theplot of weekly returns within the period of interest

Figures 11 12 and 13 show the graphical outputs of theperformed analysis In particular they respectively displayboth the filtered and smoothed probabilities for every regimeand estimated standard deviation

119905 for 119905 isin Λ

The goodness of fit analysis has been done applyingnormality tests to standardized residuals with related NPPshown in Figure 14

As in the SampP 500 case (see Section 61) both the Jarque-Bera andLilliefors tests reject the null hypothesis of normalityif they are performed taking into account the whole set ofresiduals while removing the single outlier correspondingto the smallest value of residuals (see the left-hand cornerof the NPP in Figure 14) both tests are passed and we canconclude that our 4-state MSM provides a good fitting ofexamined data In particular as in the analysis of SampP 500 wecomputed numerical values for the two statistical test with asignificance level 120572 = 5 obtaining JB = 02326 119875JB = 0500119896JB = 56006 and 119871 = 00712 119875

119871= 00553 119896

119871= 00720

7 Conclusion

In this work we have shown how a four-state Regime Switch-ingModel can be successfully exploited to study the volatilityparameter which strongly characterizes concrete financialtime series In particularwe have performed a deep analysis ofdata taken from the Standard amp Poorrsquos 500 and the DeutscheAktien Index series of returns focusing our attention on themost erratic periods for financial quantities influenced by theglobal financial crisis We provided both accurate numericalresults and related effective graphs together with a detailedoverview of the algorithms used to infer on parameters ofthe exploited switching models Applications to the abovementioned markets (see Section 6) are completed by anaccurate good of fitness study

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] H Tong Non-Linear Time Series A Dynamical System Ap-proach Oxford University Press Oxford UK 1990

[2] F Bec A Rahbek and N Shephard ldquoThe ACR model a multi-variate dynamic mixture autoregressionrdquo Oxford Bulletin ofEconomics and Statistics vol 70 no 5 pp 583ndash618 2008

[3] J Zhou and M Chen ldquoFunctional coefficient autoregressiveconditional root modelrdquo Journal of Systems Science amp Complex-ity vol 25 no 5 pp 998ndash1013 2012

[4] S M Goldfeld and R E Quandt ldquoA Markov model for switch-ing regressionsrdquo Journal of Econometrics vol 1 no 1 pp 3ndash151973

[5] J D Hamilton ldquoA new approach to the economic analysis ofnonstationary time series and the business cyclerdquo Econometricavol 57 no 2 pp 357ndash384 1989

[6] C-J Kim and C R Nelson State-Space Models with RegimeSwitching Classica l and Gibbs-Sampling Approaches with Appli-cations The MIT press 1999

[7] J D Sargan and A Bhargava ldquoTesting residuals from leastsquares regression for being generated by the Gaussian randomwalkrdquo Econometrica vol 51 no 1 pp 153ndash174 1983

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 17: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Journal of Mathematics 17

[8] W M Bolstad Introduction to Bayesian Statistics Wiley-Inter-science Hoboken NJ USA 2nd edition 2007

[9] A Gelman J B Carlin H S Stern and D B Rubin BayesianData Analysis CRCTexts in Statistical Science Series Chapmanamp Hall London UK 2003

[10] V Witkovsky ldquoComputing the distribution of a linear combi-nation of inverted gamma variablesrdquo Kybernetika vol 37 no 1pp 79ndash90 2001

[11] M ChenQ Shao and J IbrahimMonte CarloMethods in Baye-sian Computation Springer Series in Statistics 2000

[12] P Diaconis and S Holmes ldquoThree examples of Monte-CarloMarkov chains at the interface between statistical computingcomputer science and statistical mechanicsrdquo inDiscrete Proba-bility and Algorithms vol 72 of The IMA Volumes in Mathe-matics and Its Applications pp 43ndash56 Springer New York NYUSA 1993

[13] D Gamerman andH F LopesMarkov ChainMonte Carlo Sto-chastic Simulation for Bayesian Inference Texts in Statistical Sci-ence Chapman amp HallCRC New York NY USA 2nd edition2006

[14] J Albert and J S Chib ldquoBayes inference via gibbs sampling ofautoregressive time series subject toMarkovmean and varianceshiftsrdquo Journal of Business amp Economic Statistics vol 11 pp 1ndash151993

[15] C K Carter and R Kohn ldquoOn Gibbs sampling for state spacemodelsrdquo Biometrika vol 81 no 3 pp 541ndash553 1994

[16] G Casella and E I George ldquoExplaining the Gibbs samplerrdquoTheAmerican Statistician vol 46 no 3 pp 167ndash174 1992

[17] S Geman and D Geman ldquoStochastic relaxation gibbs distribu-tions and the Bayesian restoration of imagesrdquo IEEE Transac-tions on Pattern Analysis and Machine Intelligence vol 6 no 6pp 721ndash741 1984

[18] C M Jarque and A K Bera ldquoA test for normality of observa-tions and regression residualsrdquo International Statistical Reviewvol 55 no 2 pp 163ndash172 1987

[19] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression Irdquo Biometrika vol 37 no 3-4 pp 409ndash428 1950

[20] J Durbin and G S Watson ldquoTesting for serial correlation inleast squares regression IIrdquo Biometrika vol 38 no 1-2 pp 159ndash178 1951

[21] W J Conover Practical Nonparametric Statistics John Wiley ampSons 3rd edition 1999

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 18: Research Article Markov Switching Model Analysis of Implied ...ne the analysis with respect to volatility levels around themean.A neranalysiscanbealsoperformed,evenifone has to take

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of