• Non ci sono risultati.

Markov Switching Model Analysis of Implied Volatility for Market Indexes with Applications to S&P 500 and DAX

N/A
N/A
Protected

Academic year: 2021

Condividi "Markov Switching Model Analysis of Implied Volatility for Market Indexes with Applications to S&P 500 and DAX"

Copied!
18
0
0

Testo completo

(1)

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

1Department of Computer Science, University of Verona, Strada le Grazie 15, 37134 Verona, Italy 2Department 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. This 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. Then 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, often 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, often 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. The 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 often 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

Volume 2014, Article ID 753852, 17 pages http://dx.doi.org/10.1155/2014/753852

(2)

that can be considered in the RS framework, we would like to cite the threshold autoregressive (TAR) model proposed by Tong in [1], in which regime switching is controlled by a fixed threshold, the autoregressive conditional root (ACR) model of Bec et al. (see [2]) where the regime switching between stationary and nonstationary state is controlled by a binary random variable, and its extension, namely, the functional

coefficient autoregressive conditional root (FCACR) model,

considered by Zhou and Chen in [3]. In particular in this work we aim at using the RS approach to model aforemen-tioned types of unexpected changes by their dependence on an unobserved variable typically defined as the regime or

state. A customary way to formalize such an approach is given

through the following state-space representation:

𝑦𝑡= 𝑓 (𝑆𝑡, 𝜃𝜓) , 𝑡 = 1, . . . , 𝑛, 𝑛 ∈ N+, 𝑆𝑡∈ Ω, (1) where𝜃 is the vector of problem parameters, 𝜓 is the infor-mation set, the state setΩ, with |Ω| = 𝑀 ∈ N+, is the (finite) set of possible values which can be taken by the the state process𝑆 at time 𝑡, that is, 𝑆𝑡 ∈ Ω, and 𝑓 is a suitable func-tion determining the value of the dependent variable𝑦 at any given time𝑡 ∈ {1, . . . , 𝑛}.

The simplest type of structure considers two regimes; that is, Ω = {1, 2} and at most one switch in the time series: in other words, the first 𝑚 (unknown) observations relate regime 1, while the remaining𝑛 − 𝑚 data concern regime 2. Such an approach can be generalized allowing the system to switch back and forth between the two regimes, with a certain probability. The latter is the case considered by Quandt in his paper published in 1962, where it is assumed to be theo-retically possible for the system to switch between regimes every time that a new observation is generated. Note that previous hypothesis is not realistic in an economic context, since it contradicts the volatility clustering property, typical of financial time series.

The best way to represent the volatility clusters phe-nomenon consists in assuming that the state variable follows a Markov chain and claiming that the probability of having a switch in the next time is much lower than the probability of remaining in the same economic regime. The Markovian switching mechanism was first considered by Goldfeld and Quandt in [4] and then extended by Hamilton to the case of structural changes in the parameters of an autoregres-sive process (see [5]). When the unobserved state variable that controls the switching mechanism follows a first-order Markov chain, the RS model is called Markov Switching Model (MSM). In particular the Markovian property of such a model implies that, given𝑡 ∈ {2, . . . , 𝑛}, the value 𝑆𝑡of the state variable depends only on𝑆𝑡−1, a property that turns out to be useful to obtain a good representation of financial data, where abrupt changes occur occasionally.

After Hamilton’s papers, Markov switching models have been widely applied, together with a number of alternative versions, to analyze different type of both economic and financial time series, for example, stock options behaviors, energy markets trends, and interest rates series. In what

follows we shall often refer to the following, actually rather general, form for an MSM:

𝑦𝑡= 𝑓 (𝑆𝑡, 𝜃)

𝑆𝑡∈ {1, 2, . . . , 𝑀} with probabilities

𝑝𝑖𝑗:= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖) , 𝑖, 𝑗 = 1, 2, . . . , 𝑀, 𝑡 = 2, . . . , 𝑛, (2) where the terms 𝑝𝑖𝑗 are nothing but the transition prob-abilities, from state 𝑖 at time 𝑡 − 1 to state 𝑗 at time 𝑡, which determine the stochastic dynamic of the process𝑆 = {𝑆𝑡}𝑡=1,...,𝑛.

In Section 2 we recall the classical approach to MSM following [5] and with respect to both serially uncorrelated and correlated data. Then, in Section 3, we first introduce basic facts related to the Bayesian inference; then we recall the Gibbs sampling technique and related Monte Carlo approximation method which is later used to infer on the MSM parameters. Section 4 is devoted to a goodness of fit (of obtained estimates for parameters of interest) analysis, while inSection 5we describe our forecasting MSM-based procedure which is then used inSection 6to analyse both the

Standard & Poor’s 500 and the Deutsche Aktien indexes.

2. The Classical Approach

In this section we shall use the classical approach (see, for example, [5]) to develop procedures which allow us to make inference on unobserved variables and parameters characterizing MSM. The main idea behind such an approach is splitin two steps: first we estimate the model’s unknown parameters by a maximum likelihood method; secondly we infer the unobserved switching variable values conditional on the parameter estimates. Along latter lines, we shall analyze two different MSM settings, namely, the case in which data are serially uncorrelated, and the case when they are

autocorrelated.

2.1. Serially Uncorrelated Data. Let us suppose that 𝑆 =

{𝑆𝑡}𝑡∈{1,...,𝑇}, 𝑇 ∈ N+, is a discrete time stochastic process represented by a first-order Markov chain taking value in some setΩ = {1, . . . , 𝑀}, with transition probabilities:

𝑝𝑖𝑗:= P (𝑆𝑡+1= 𝑗 | 𝑆𝑡= 𝑖, 𝑆𝑡−1= 𝑖𝑡−1, . . . , 𝑆0= 𝑖0) = P (𝑆𝑡+1= 𝑗 | 𝑆𝑡= 𝑖) , ∀𝑡 ∈ {2, . . . , 𝑇} . (3) Then the state-space model we want to study is given by

𝑦𝑡= 𝜇𝑆𝑡+ 𝜖𝑡, 𝑡 = 1, 2, . . . , 𝑇, {𝜖𝑡}𝑡∈{1,...,𝑇} are i.i.d. N (0, 𝜎2𝑆𝑡) , 𝜇𝑆𝑡= 𝜇1𝑆1,𝑡+ ⋅ ⋅ ⋅ + 𝜇𝑀𝑆𝑀,𝑡, 𝜎𝑆𝑡= 𝜎1𝑆1,𝑡+ ⋅ ⋅ ⋅ + 𝜎𝑀𝑆𝑀,𝑡, 𝑆𝑡∈ {1, . . . , 𝑀} with probabilities 𝑝𝑖𝑗, (4)

(3)

where the variables𝑆𝑘,𝑡,(𝑘, 𝑡) ∈ {1, . . . , 𝑀} × {1, . . . , 𝑇} are introduced in order to have a slightly compact equation for 𝜇𝑆𝑡and𝜎𝑆𝑡: in particular,𝑆𝑘,𝑡 = 1 if 𝑆𝑡 = 𝑘, otherwise 𝑆𝑘,𝑡 = 0, which implies that under regime 𝑘, for 𝑘 ∈ {1, . . . , 𝑀}, parameters of mean and variance are given by𝜇𝑘and𝜎𝑘.

Let us underline that in (4) the 𝑦𝑡 are our observed data, for example, historical returns of a stock or some index time series, and we suppose that they are locally distributed as Gaussian random variable in the sense that occasionally jumps could occur for both the mean𝜇𝑆𝑡 and the variance 𝜎2𝑆𝑡. In particular, we assume that 𝜎1 < 𝜎2 < ⋅ ⋅ ⋅ < 𝜎𝑀 and we want to estimate these 𝑀 unobserved values for standard deviation, as well as the𝑀 values for the switching mean. Note that we could also take𝜇 as a constant, obtaining the so called switching variance problem or𝜎 as a constant, having a switching mean problem. The first one is in general more interesting in the analysis of financial time series, since variance is usually interpreted as an indicator for the market’s volatility.

Given the model described by(4), the conditional density of 𝑦𝑡 given 𝑆𝑡 is Gaussian with mean 𝜇𝑆𝑡 and standard deviation𝜎𝑆𝑡; namely, its related probability density function reads as follow: 𝑓𝑦𝑡|𝑆𝑡(𝑥) = 1 √2𝜋𝜎2 𝑆𝑡 𝑒−(𝑥−𝜇𝑆𝑡)2/2𝜎𝑆𝑡2, 𝑥 ∈ R, (5) and we are left with the problem of estimating both the expec-tations 𝜇1, . . . , 𝜇𝑀 and the standard deviations 𝜎1, . . . , 𝜎𝑀 parameters; a task that is standard to solve by maximizing the associated log-likelihood function lnL defined as follows:

lnL :=

𝑇

𝑡=1

ln(𝑓𝑦𝑡|𝑆𝑡) . (6) A different and more realistic scenario is the one character-ized by unobserved values for𝑆𝑡. 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 𝑆𝑡, 𝑡 = 1, . . . , 𝑇 conditional on the estimates obtained at previous point.

Depending on the amount of information we can use inferencing on𝑆𝑡, we have

(i) filtered probabilities that refer to inferences about𝑆𝑡 conditional on information up to time𝑡, namely, with respect to𝜓𝑡,

(ii) smoothed probabilities that refer to inferences about𝑆𝑡 conditional to the whole sample (history),𝜓𝑇. In what follows we describe a step-by-step algorithm which allows us to resolve the filtering problem for a sample of serially uncorrelated data. In particular we slightly generalize the approach given in [6], assuming that the state variable𝑆𝑡

belongs to a 4-state space setΩ := {1, 2, 3, 4}, at every time 𝑡 = 1, . . . , 𝑇. Despite 2-state (expansion/contraction) and 3-state (low/medium/high volatility regime) models being the usual choices, we decided to consider 4-state MSM in order to refine the analysis with respect to volatility levels around the mean. A finer analysis can be also performed, even if one has to take into account the related nonlinear computational growth. We first define the log-likelihood function at time𝑡 as

𝑙 (𝜃, 𝜓𝑡) = 𝑙 (𝜇1, . . . , 𝜇𝑀, 𝜎1, . . . , 𝜎𝑀, 𝜓𝑡) , (7) where𝜃 := (𝜇1, . . . , 𝜇𝑀, 𝜎1, . . . , 𝜎𝑀) is the vector of parame-ters that we want to estimate. Let us note that the𝜃 is updated at every iteration, since we maximize with respect to the function𝑙(𝜃, 𝜓𝑡) at every stage of our step-by-step procedure. In particular the calibrating procedure reads as follows.

Inputs.

(i) Put𝑙(𝜃) := 𝑙(𝜃, 𝜓0) = 0.

(ii) Compute the transition probabilities of the homoge-neous Markov chain underlying the state variable; that is,

𝑝𝑖𝑗= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖) , 𝑖, 𝑗 ∈ Ω. (8)

Since in the applications we can only count on return time series, we first have to calibrate with respect to the transition probabilities𝑝𝑖𝑗:

(1) choose 4 values 𝜎21 < 𝜎22 < 𝜎23 < 𝜎42 (e.g., 𝜎1 = 0.1, 𝜎2 = 0.2, 𝜎3 = 0.3, and 𝜎4 = 0.4)

and a positive, arbitrary small, constant𝛿 > 0, for example,𝛿 = 0.01,

(2) compute for every𝑗 = 1, 2, 3, 4 and for every 𝑡 = 1, . . . , 𝑇 the values 𝑏𝑗 := Φ (𝑦𝑡+ 𝛿) − Φ (𝑦𝑡− 𝛿) = ∫𝑦𝑡+𝛿 𝑦𝑡−𝛿 1 √2𝜋𝜎2 𝑗 exp [ [ (𝑥 − 𝜇𝑗)2 2𝜎2 𝑗 ] ] , (9)

(3) simulate a value in{1, 2, 3, 4} for 𝑆𝑡at each time from the discrete probability vector

( 𝑏1 ∑4𝑗=1𝑏𝑗, 𝑏2 ∑4𝑗=1𝑏𝑗, 𝑏3 ∑4𝑗=1𝑏𝑗, 𝑏4 ∑4𝑗=1𝑏𝑗) , (10) (4) set the transition probabilities𝑝𝑖𝑗just by count-ing the number of transition from state𝑖 to state 𝑗, for 𝑖, 𝑗 = 1, . . . , 4, in order to obtain the following transition matrix:

𝑃∗ = ( 𝑝11 𝑝12 𝑝13 𝑝14 𝑝21 𝑝22 𝑝23 𝑝24 𝑝31 𝑝32 𝑝33 𝑝34 𝑝41 𝑝42 𝑝43 𝑝44 ) . (11)

(4)

(iii) Compute the steady-state probabilities

𝜋 (0) = (P (𝑆0= 1 | 𝜓0) , . . . , P (𝑆0= 4 | 𝜓0)) . (12)

Let us note that, by definition, if𝜋(𝑡) is a 4 × 1 vector of steady-state probabilities, then𝜋(𝑡 + 1) = 𝜋(𝑡) for every 𝑡 = 1, . . . , 𝑇; moreover 𝜋(𝑡 + 1) = 𝑃∗𝜋(𝑡), and (see for example, [6, pag. 71]) we also have that 𝜋(𝑡) = (𝐴𝑇𝐴)−1𝐴𝑇[04

1], where 04is a4 × 1 matrix of

zeros and𝐴 = (Id4−𝑃∗

14 ), Id4is the four dimensional

identity matrix, while14 = (1, 1, 1, 1), that is, the vector of steady-state probabilities is the last column of the matrix(𝐴𝑇𝐴)−1𝐴𝑇.

Next we perform the following steps, for𝑡 = 1, . . . , 𝑇.

Step 1. The probability of𝑆𝑡conditional to information set at

time𝑡 − 1 is given by P (𝑆𝑡= 𝑗 | 𝜓𝑡−1) =∑4

𝑖=1

𝑝𝑖𝑗P (𝑆𝑡−1= 𝑖 | 𝜓𝑡−1) , 𝑗 = 1, . . . , 4. (13)

Step 2. Compute the joint density of𝑦𝑡and𝑆𝑡conditional to

the information set𝜓𝑡−1

𝑓 (𝑦𝑡, 𝑆𝑡= 𝑗 | 𝜓𝑡−1) = 𝑓 (𝑦𝑡| 𝑆𝑡= 𝑗, 𝜓𝑡−1)

× P (𝑆𝑡= 𝑗 | 𝜓𝑡−1) , 𝑗 = 1, . . . , 4. (14) The marginal density of𝑦𝑡is given by the sum of the joint density over all values of𝑆𝑡

𝑓 (𝑦𝑡| 𝜓𝑡−1) =∑4

𝑖=1

𝑓 (𝑦𝑡| 𝑆𝑡= 𝑖, 𝜓𝑡−1) P (𝑆𝑡= 𝑖 | 𝜓𝑡−1) . (15)

Step 3. Update the log-likelihood function at time𝑡 in the

following way:

𝑙 (𝜃, 𝜓𝑡) = 𝑙 (𝜃, 𝜓𝑡−1) + ln (𝑓 (𝑦𝑡| 𝜓𝑡−1)) , (16) and maximize 𝑙(𝜃, 𝜓𝑡) with respect to 𝜃 = (𝜇1, . . . , 𝜇4, 𝜎1, . . . , 𝜎4), under the condition 𝜎1 < 𝜎2 < 𝜎3 < 𝜎4, to find the maximum likelihood estimator ̂𝜃 for the next time period.

Step 4. Once𝑦𝑡is observed at the end of the𝑡th iteration, we

can update the probability term: P (𝑆𝑡= 𝑗 | 𝜓𝑡)

= 𝑓 (𝑦𝑡𝑆𝑡= 𝑗, 𝜓𝑡−1) P (𝑆𝑡= 𝑗𝜓𝑡−1) ∑4𝑖=1𝑓 (𝑦𝑡| 𝑆𝑡= 𝑖, 𝜓𝑡−1) P (𝑆𝑡= 𝑖 | 𝜓𝑡−1),

𝑗 = 1, . . . , 4,

(17)

where both𝜓𝑡 = {𝜓𝑡−1, 𝑦𝑡} and 𝑓(𝑦𝑡 | 𝑆𝑡 = 𝑖, 𝜓𝑡−1) are com-puted with respect to the estimator ̂𝜃 = (̂𝜇1, . . . , ̂𝜇4, ̂𝜎1, . . . , ̂𝜎4).

2.2. Serially Correlated Data. In some cases it is possible to

argue and mathematically test by, for example, the Durbin-Watson statistics or Breusch-Godfrey test, for the presence of a serial correlation (or autocorrelation) between data belong-ing to a certain time series of interest. Such a characteristic is often analyzed in signal processing scenario, but examples can be also found in economic, meteorological, or sociolog-ical data sets, especially in connection with autocorrelation of errors in related forecasting procedure. In particular if we suppose that the observed variable𝑦𝑡 linearly depends on its previous value, then we obtain a first-order autoregressive

pattern and the following state-space model applies:

𝑦𝑡− 𝜇𝑆𝑡= 𝜙 (𝑦𝑡−1− 𝜇𝑆𝑡−1) + 𝜖𝑡, 𝑡 = 1, 2, . . . , 𝑇, {𝜖𝑡}𝑡∈{1,...,𝑇} are i.i.d. N (0, 𝜎2𝑆𝑡) , 𝜇𝑆𝑡= 𝜇1S1,𝑡+ ⋅ ⋅ ⋅ + 𝜇𝑀𝑆𝑀,𝑡, 𝜎𝑆𝑡= 𝜎1𝑆1,𝑡+ ⋅ ⋅ ⋅ + 𝜎𝑀𝑆𝑀,𝑡, 𝑆𝑡∈ {1, . . . , 𝑀} with probabilities 𝑝𝑖𝑗, (18) where𝑝𝑖𝑗 := P(𝑆𝑡 = 𝑗 | 𝑆𝑡−1 = 𝑖), 𝑖, 𝑗 = 1, . . . , 𝑀 and 𝑆𝑘,𝑡, and (𝑘, 𝑡) ∈ {1, . . . , 𝑀} × {1, . . . , 𝑇} are the same variables introduced in the previous section; that is,𝑆𝑘,𝑡 = 1 if 𝑆𝑡= 𝑘, otherwise𝑆𝑘,𝑡= 0.

In this situation, if the state𝑆𝑡 is known for every𝑡 = 1, . . . , 𝑇, we need 𝑆𝑡and 𝑆𝑡−1 to compute the density of 𝑦𝑡 conditional to past information𝜓𝑡−1, indeed we have

lnL := 𝑇 ∑ 𝑡=1 ln(𝑓𝑦𝑡|𝜓𝑡−1,𝑆𝑡,𝑆𝑡−1) , (19) where 𝑓𝑦𝑡|𝜓𝑡−1,𝑆𝑡,𝑆𝑡−1(𝑥) = 1 √2𝜋𝜎2 𝑆𝑡 𝑒−(𝑥−𝜇𝑆𝑡−𝜙(𝑦𝑡−1−𝜇𝑆𝑡−1))2/2𝜎𝑆𝑡2, 𝑥 ∈ R. (20) If 𝑆𝑡 are unobserved (and as before we assume that the state variable can take the four values{1, 2, 3, 4}), we apply the following algorithm in order to resolve the filtering problem for a sample of serially correlated data.

Inputs.

(i) Put𝑙(𝜃) := 𝑙(𝜃, 𝜓0) = 0.

(ii) Compute the transition probabilities

𝑝𝑖𝑗= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖) , 𝑖, 𝑗 = 1, 2, 3, 4. (21)

We apply the same trick as before, but firstly we have to estimate the parameter𝜙: in order to obtain this value we can use the least square methods (see for example, [7]) that is,

̂𝜙 := ∑𝑇𝑡=1𝑦𝑡𝑦𝑡+1

∑𝑇𝑡=1𝑦2 𝑡

(5)

Then we compute𝑧𝑡:= 𝑦𝑡−𝜙𝑦𝑡−1for every𝑡 = 1, . . . , 𝑇 and consider the values𝑏𝑗 := Φ(𝑧𝑡+ 𝛿) − Φ(𝑧𝑡− 𝛿) (we apply the Normal distribution function to𝑧𝑡+ 𝛿 instead of𝑦𝑡+ 𝛿, as done before).

(iii) Compute the steady-state probabilities

𝜋 (0) = (P (𝑆0= 1 | 𝜓0) , . . . , P (𝑆0= 4 | 𝜓0)) , (23)

taking the last column of the matrix(𝐴𝑇𝐴)−1𝐴𝑇(see procedure inSection 2.1for details).

Next perform the following steps for𝑡 = 1, . . . , 𝑇.

Step 1. Compute the probabilities of𝑆𝑡conditional to

infor-mation set at time𝑡 − 1, for 𝑗 = 1, . . . , 4 P (𝑆𝑡= 𝑗 | 𝜓𝑡−1) =∑4 𝑖=1 P (𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖 | 𝜓𝑡−1) =∑4 𝑖=1𝑝𝑖𝑗P (𝑆𝑡−1 = 𝑖 | 𝜓𝑡−1) . (24)

Step 2. Compute the joint density of𝑦𝑡, 𝑆𝑡, and 𝑆𝑡−1 given

𝜓𝑡−1:

𝑓 (𝑦𝑡, 𝑆𝑡, 𝑆𝑡−1| 𝜓𝑡−1) = 𝑓 (𝑦𝑡| 𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖, 𝜓𝑡−1) × P (𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖 | 𝜓𝑡−1) , (25) where 𝑓(𝑦𝑡 | 𝑆𝑡 = 𝑗, 𝑆𝑡−1 = 𝑖, 𝜓𝑡−1) is given by (20)and P(𝑆𝑡= 𝑗, 𝑆𝑡−1 = 𝑖 | 𝜓𝑡−1) is computed inStep 1. The marginal density of𝑦𝑡conditional on𝜓𝑡−1is obtained by summing over all values of𝑆𝑡and𝑆𝑡−1:

𝑓 (𝑦𝑡| 𝜓𝑡−1) = ∑4 𝑗=1 4 ∑ 𝑖=1 𝑓 (𝑦𝑡| 𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖, 𝜓𝑡−1) × P (𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖 | 𝜓𝑡−1) . (26)

Step 3. The log-likelihood function at time𝑡 is again

𝑙 (𝜃, 𝜓𝑡) = 𝑙 (𝜃, 𝜓𝑡−1) + ln (𝑓 (𝑦𝑡| 𝜓𝑡−1)) , (27) and it can be maximized with respect to 𝜃 = (𝜇1, . . . , 𝜇4, 𝜎1, . . . , 𝜎4), under condition 𝜎1 < 𝜎2 < 𝜎3 < 𝜎4, giving the maximum likelihood estimator ̂𝜃 for the next time period.

Step 4. Update the joint probabilities of𝑆𝑡and 𝑆𝑡−1

condi-tional to the new information set 𝜓𝑡, using the estimator ̂𝜃 computed in Step 3 by maximizing the log-likelihood function𝑙(𝜃, 𝜓𝑡):

P (𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖 | 𝜓𝑡)

= 𝑓 (𝑦𝑡, 𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖 | 𝜓𝑡−1)

𝑓 (𝑦𝑡| 𝜓𝑡−1) , 𝑖, 𝑗 = 1, . . . , 4. (28)

Then compute the updated probabilities of𝑆𝑡given𝜓𝑡by summing the joint probabilities over𝑆𝑡−1as follows:

P (𝑆𝑡= 𝑗 | 𝜓𝑡) = 4 ∑ 𝑖=1 P (𝑆𝑡= 𝑗, 𝑆𝑡−1= 𝑖 | 𝜓𝑡) , ∀𝑗 = 1, . . . , 4. (29)

The Smoothing Algorithm. Once we have run this procedure,

we are provided with the filtered probabilities, that is, the valuesP(𝑆𝑡= 𝑗 | 𝜓𝑡) for 𝑗 = 1, . . . , 4 and for each 𝑡 = 1, . . . , 𝑇 (in addition to the estimator ̂𝜃).

Sometimes it is required to estimate probabilities of 𝑆𝑡 given the whole sample information; that is,

P (𝑆𝑡= 𝑗 | 𝜓𝑇) = P (𝑆𝑡= 𝑗 | 𝑦1, . . . , 𝑦𝑇) , ∀𝑗 = 1, . . . , 4, (30) which are called smoothed probabilities. We are going to show how these new probabilities can be computed from previous procedure (the same algorithm, although with some obvious changes, can be still used starting from procedure in Section

2.1).

Since the last iteration of the algorithm gives us the probabilitiesP(𝑆𝑇 = 𝑗 | 𝜓𝑇) for 𝑗 = 1, . . . , 4, we can start from these values and use the following procedure by doing the two steps for every𝑡 = 𝑇 − 1, 𝑇 − 2, . . . , 2, 1.

Step 1. For𝑖, 𝑗 = 1, . . . , 4, compute

P (𝑆𝑡= 𝑖, 𝑆𝑡+1= 𝑗 | 𝜓𝑇) = P (𝑆𝑡+1= 𝑗 | 𝜓𝑇) P (𝑆𝑡= 𝑖 | 𝑆𝑡+1= 𝑗, 𝜓𝑇) = P (𝑆𝑡+1= 𝑗 | 𝜓𝑇) P (𝑆𝑡= 𝑖 | 𝑆𝑡+1= 𝑗, 𝜓𝑡) = P (𝑆𝑡+1= 𝑗 | 𝜓𝑇)P (𝑆𝑡= 𝑖, 𝑆𝑡+1= 𝑗 | 𝜓𝑡) P (𝑆𝑡+1= 𝑗 | 𝜓𝑡) . (∗)

Remark 1. Note that equality(∗), that is,

P (𝑆𝑡= 𝑖 | 𝑆𝑡+1= 𝑗, 𝜓𝑇) = P (𝑆𝑡= 𝑖 | 𝑆𝑡+1= 𝑗, 𝜓𝑡) , (31) holds only under a particular condition; namely,

𝑓 (ℎ𝑡+1,𝑇| 𝑆𝑡+1= 𝑗, 𝑆𝑡= 𝑖, 𝜓𝑡) = 𝑓 (ℎ𝑡+1,𝑇| 𝑆𝑡+1= 𝑗, 𝜓𝑡) , (32) whereℎ𝑡+1,𝑇 := (𝑦𝑡+1, . . . , 𝑦𝑇)󸀠(see [6] for the proof). Equa-tion(32)suggests that if𝑆𝑡+1 were known, then𝑦𝑡+1 would contain no information about𝑆𝑡 beyond that contained in 𝑆𝑡+1 and 𝜓𝑡and does not hold for every state-space model with regime switching (see, for example, [6, Ch. 5]) in which case the smoothing algorithm involves an approximation.

Step 2. For𝑖 = 1, . . . , 4 compute

P (𝑆𝑡= 𝑖 | 𝜓𝑇) =∑4

𝑗=1

P (𝑆𝑡= 𝑖, 𝑆𝑡+1= 𝑗 | 𝜓𝑇) . (33)

3. The Gibbs Sampling Approach

3.1. An Introduction to Bayesian Inference. Under the general

title Bayesian inference we can collect a large number of different concrete procedures; nevertheless they are all based on smart use of the Bayes’ rule which is used to update the probability estimate for a hypothesis as additional evidence is learned (see, for example, [8, 9]). In particular, within

(6)

the Bayesian framework, the parameters, for example, let us collect them in a vector called𝜃, which characterize a certain statistic model and are treated as random variables with their own probability distributions; let us say𝑓(𝜃), which plays the role of a prior distribution since it is defined before taking into account the sample data ̃𝑦. Therefore, exploiting the Bayes’ theorem and denoting by𝑓( ̃𝑦 | 𝜃) the likelihood of ̃𝑦 of the interested statistic model, we have that

𝑓 (𝜃 | ̃𝑦) = 𝑓 ( ̃𝑦 | 𝜃) 𝑓 (𝜃)

𝑓 ( ̃𝑦) , (34)

where 𝑓(𝜃 | ̃𝑦) is the joint posterior distribution of the parameters. The denominator 𝑓( ̃𝑦) defines the marginal likelihood of ̃𝑦 and can be taken as a constant, obtaining the proportion

𝑓 (𝜃 | ̃𝑦) ∝ 𝑓 ( ̃𝑦 | 𝜃) 𝑓 (𝜃) . (35) It is straightforward to note that the most critical part of the Bayesian inference procedure relies in the choice of a suitable prior distribution, since it has to agree with parameters constraints. An effective answer to latter issue is given by the so called conjugate prior distribution, namely the distribution obtained when the conjugate prior is combined with the likelihood function. Let us note that the posterior distribution 𝑓(𝜃 | ̃𝑦) is in the same family as the prior distribution.

As an example, if the likelihood function is Gaussian, it can be shown that the conjugate prior for the mean𝜇 is the Gaussian distribution, whereas the conjugate prior for the variance is the inverted Gamma distribution (see, for example, [9,10]).

3.2. Gibbs Sampling. A general problem in Statistics concerns

the question of how a sequence of observations which cannot be directly sampled, can be simulated, for example, by mean of some multivariate probability distribution, with a prefixed precision degree of accuracy. Such kind of problems can be successfully attacked by Monte Carlo Markov Chain (MCMC) simulation methods, see, for example, [11–13], and in particular using the so called Gibbs Sampling technique which allows to approximate joint and marginal distributions by sampling from conditional distributions, see, for example, [14–16].

Let us suppose that we have the joint density of𝑘 random variables, for example,𝑓 = 𝑓(𝑧1, 𝑧2, . . . , 𝑧𝑘), fix 𝑡 ∈ {1, . . . , 𝑘} and that we are interested in in obtaining characteristics of the𝑧𝑡-marginal, namely

𝑓 (𝑧𝑡) = ∫ ⋅ ⋅ ⋅ ∫ 𝑓 (𝑧1, 𝑧2, . . . , 𝑧𝑘) 𝑑𝑧1⋅ ⋅ ⋅ 𝑑𝑧𝑡−1𝑑𝑧𝑡+1⋅ ⋅ ⋅ 𝑑𝑧𝑘, (36) such as the related mean and/or variance. In those cases when the joint density is not given, or the above integral turns out to be difficult to treat, for example, an explicit solution does not exist, but we know the complete set of conditional densities, denoted by 𝑓(𝑧t | 𝑧𝑗 ̸=𝑡), 𝑡 = 1, 2, . . . , 𝑘, with

𝑧𝑗 ̸=𝑡 = {𝑧1, . . . , 𝑧𝑡−1, 𝑧𝑡+1, . . . , 𝑧𝑘}, then the Gibbs Sampling method allows us to generate a sample𝑧𝑗1, 𝑧𝑗2, . . . , 𝑧𝑗𝑘from the

joint density𝑓(𝑧1, 𝑧2, . . . , 𝑧𝑘) without requiring that we know either the joint density or the marginal densities. With the following procedure we recall the basic ideas on which the Gibbs Sampling approach is based given an arbitrary starting set of values(𝑧02, . . . , 𝑧𝑘0).

Step 1. Draw𝑧11from𝑓(𝑧1| 𝑧20, . . . , 𝑧0𝑘).

Step 2. Draw𝑧12from𝑓(𝑧2| 𝑧11, 𝑧30, . . . , 𝑧0𝑘).

Step 3. Draw𝑧31from𝑓(𝑧3| 𝑧11, 𝑧21, 𝑧40, . . . , 𝑧𝑘0).

...

Step k. Finally draw𝑧1𝑘from𝑓(𝑧𝑘 | 𝑧11, . . . , 𝑧𝑘−11 ) to complete

the first iteration.

The steps from1through𝑘 can be iterated 𝐽 times to get (𝑧1𝑗, 𝑧𝑗2, . . . , 𝑧𝑘𝑗), 𝑗 = 1, 2, . . . , 𝐽.

In [17] S. Geman and D. Geman showed that both the joint and marginal distributions of generated(𝑧1𝑗, 𝑧𝑗2, . . . , 𝑧𝑘𝑗), converge, at an exponential rate, to the joint and marginal distributions of 𝑧1, 𝑧2, . . . , 𝑧𝑘, as 𝐽 → ∞. Thus the joint and marginal distributions of𝑧1, 𝑧2, . . . , 𝑧𝑘 can be approxi-mated by the empirical distributions of𝑀 simulated values (𝑧1𝑗, 𝑧𝑗2, . . . , 𝑧𝑘𝑗), 𝑗 = 𝐿 + 1, . . . , 𝐿 + 𝑀, where 𝐿 is large enough to assure the convergence of the Gibbs sampler. Moreover𝑀 can be chosen to reach the required precision with respect to the empirical distribution of interest.

In the MSM framework we do not have conditional distributions𝑓(𝑧𝑡| 𝑧𝑗 ̸=𝑡), 𝑡 = 1, 2, . . . , 𝑘, and we are left with the problem of estimate parameters𝑧𝑖,𝑖 = 1, . . . , 𝑘. Latter problem can be solved exploiting Bayesian inference results, as we shall state in the next section.

3.3. Gibbs Sampling for Markov Switching Models. A major

problem when dealing with inferences from Markov switch-ing models relies in the fact that some parameters of the model are dependent on an unobserved variable, let us say 𝑆𝑡. We saw that in the classical framework, inference on Markov switching models consists first in estimating the model’s unknown parameters via maximum likelihood, then inference on the unobserved Markov switching variable ̃𝑆𝑇= (𝑆1, 𝑆2, . . . , 𝑆𝑇), conditional on the parameter estimates, has to be perfomed.

In the Bayesian analysis, both the parameters of the model and the switching variables𝑆𝑡, 𝑡 = 1, . . . , 𝑇 are treated as ran-dom variables. Thus, inference on ̃𝑆𝑇is based on a joint dis-tribution, no more on a conditional one. By employing Gibbs sampling techniques, Albert and Chib (see [14]) provided an easy to implement algorithm for the Bayesian analysis of Markov switching models. In particular in their work the parameters of the model and𝑆𝑡,𝑡 = 1, . . . , 𝑇 are treated as missing data, and they are generated from appropriate con-ditional distributions using Gibbs sampling method. As an example, let us consider the following simple model with two-state Markov switching mean and variance:

(7)

{𝜖𝑡}𝑡∈{1,...,𝑇} are i.i.d. N (0, 𝜎𝑆2𝑡) , 𝜇𝑆𝑡= 𝜇0+ 𝜇1𝑆𝑡,

𝜎𝑆𝑡= 𝜎02(1 − 𝑆𝑡) + 𝜎12𝑆𝑡= 𝜎20(1 + ℎ1𝑆𝑡) , ℎ1> 0, (37) where𝑆𝑡∈ {0, 1} with transition probabilities 𝑝 := P(𝑆𝑡= 0 | 𝑆𝑡−1 = 0), 𝑞 := P(𝑆𝑡 = 1 | 𝑆𝑡−1 = 1). The Bayesian method consider both𝑆𝑡,𝑡 = 1, . . . , 𝑇 and the model’s unknown para-meters𝜇0,𝜇1,𝜎0,𝜎1,𝑝 and 𝑞, as random variables. In order to make inference about these𝑇 + 6 variables, we need to derive the joint posterior density𝑓(̃𝑆𝑇, 𝜇0, 𝜇1, 𝜎20, 𝜎21, 𝑝, 𝑞 | 𝜓𝑇), where 𝜓𝑇 := (𝑦1, 𝑦2, . . . , 𝑦𝑇) and ̃𝑆𝑇 = (𝑆1, 𝑆2, . . . , 𝑆𝑇). Namely the realization of the Gibbs sampling relies on the derivation of the distributions of each of the above𝑇 + 6 variables, conditional on all the other variables. Therefore we can approximate the joint posterior density written above by running the following procedure𝐿 + 𝑀 times, where 𝐿 is an integer large enough to guarantee the desired convergence. Hence we have the following scheme.

Step 1. We can derive the distribution of𝑆𝑡,𝑡 = 1, . . . , 𝑇

con-ditional on the other parameters in two different ways. (1) Single-move gibbs sampling: generate each 𝑆𝑡 from

𝑓(𝑆𝑡 | ̃𝑆 ̸=𝑡, 𝜇0, 𝜇1, 𝜎2

0, 𝜎12, 𝑝, 𝑞, 𝜓𝑇), 𝑡 = 1, . . . , 𝑇, where

̃𝑆̸=𝑡= (𝑆1, . . . , 𝑆𝑡−1, 𝑆𝑡+1, . . . , 𝑆𝑇).

(2) Multi-move gibbs sampling: generate the whole block ̃𝑆𝑇from𝑓(̃𝑆𝑇| 𝜇0, 𝜇1, 𝜎02, 𝜎12, 𝑝, 𝑞, 𝜓𝑇).

Step 2. Generate the transition probabilities𝑝 and 𝑞 from

𝑓(𝑝, 𝑞 | ̃𝑆𝑇). Note that this distribution is conditioned only on ̃𝑆𝑇because we assume that𝑝 and 𝑞 are independent of both the other parameters of the model and the data,𝜓𝑇.

If we choose the Beta distribution as prior distribution for both𝑝 and 𝑞, we have that posterior distribution 𝑓(𝑝, 𝑞 | ̃𝑆𝑇) = 𝑓(𝑝, 𝑞)𝐿(𝑝, 𝑞 | ̃𝑆𝑇) is again a Beta distribution. So,

Beta distribution is a conjugate prior for the likelihood of transition probabilities.

Step 3. Generate𝜇0 and𝜇1 from𝑓(𝜇0, 𝜇1 | ̃𝑆𝑇, 𝜎02, 𝜎12, 𝑝, 𝑞,

𝜓𝑇). In this case the conjugate prior is the Normal distribution.

Step 4. Generate𝜎20 and𝜎12 from𝑓(𝜎02, 𝜎21 | ̃𝑆𝑇, 𝜇0, 𝜇1, 𝑝, 𝑞,

𝜓𝑇). From definition of the model we have that 𝜎2

1 = 𝜎20(1 +

1): we can first generate 𝜎2

0 conditional on ℎ1, and then

generateℎ1 = 1 + ℎ1conditional on𝜎02. We use in both cases the Inverted Gamma distribution as conjugate prior for the parameters.

For a more detailed description of these steps (see [6, pp. 211–218]). Here we examine only the so called

Multi-move Gibbs sampling, originally motivated by Carter and

Kohn (see [15]) in the context of state space models and then implemented in [6] for a MSM. For the sake of simplicity,

let us suppress the conditioning on model’s parameters and denote

𝑓 (̃𝑆𝑇| 𝜓𝑇) := 𝑓 (̃𝑆𝑇| 𝜇0, 𝜇1, 𝜎02, 𝜎12, 𝑝, 𝑞, 𝜓𝑇) . (38) Using the Markov property of{𝑆𝑡}𝑡∈{1,...,𝑇} it can be seen that

𝑓 (̃𝑆𝑇| 𝜓𝑇) = 𝑓 (𝑆𝑇| 𝜓𝑇)𝑇−1∏

𝑡=1

𝑓 (𝑆𝑡| 𝑆𝑡+1, 𝜓𝑡) , (39) where 𝑓(𝑆𝑇 | 𝜓𝑇) = P(𝑆𝑇 | 𝜓𝑇) is provided by the last iteration of filtering algorithm (see Sections2.1and2.2). Note that(39)suggests that we can first generate𝑆𝑇conditional on 𝜓𝑇and then, for𝑡 = 𝑇 − 1, 𝑇 − 2, . . . , 1, we can generate 𝑆𝑡

conditional on𝜓𝑡and𝑆𝑡+1, namely we can run the following steps.

Step 1. Run the basic filter procedure to get𝑓(𝑆𝑡 | 𝜓𝑡), 𝑡 =

1, 2, . . . , 𝑇 and save them; the last iteration of the filter gives us the probability distribution𝑓(𝑆𝑇 | 𝜓𝑇), from which 𝑆𝑇is generated.

Step 2. Note that

𝑓 (𝑆𝑡| 𝑆𝑡+1, 𝜓𝑡) = 𝑓 (𝑆𝑡, 𝑆𝑡+1| 𝜓𝑡) 𝑓 (𝑆𝑡+1| 𝜓𝑡) = 𝑓 (𝑆𝑡+1| 𝑆𝑡, 𝜓𝑡) 𝑓 (𝑆𝑡| 𝜓𝑡) 𝑓 (𝑆𝑡+1| 𝜓𝑡) = 𝑓 (𝑆𝑡+1| 𝑆𝑡) 𝑓 (𝑆𝑡| 𝜓𝑡) 𝑓 (𝑆𝑡+1| 𝜓𝑡) ∝ 𝑓 (𝑆𝑡+1| 𝑆𝑡) 𝑓 (𝑆𝑡| 𝜓𝑡) , (40) where𝑓(𝑆𝑡+1| 𝑆𝑡) is the transition probability and 𝑓(𝑆𝑡| 𝜓𝑡) has been saved from Step 1. So we can generate 𝑆𝑡 in the following way, first calculate

P (𝑆𝑡= 1 | 𝑆𝑡+1, 𝜓𝑡)

= 𝑓 (𝑆𝑡+1| 𝑆𝑡= 1) 𝑓 (𝑆𝑡= 1 | 𝜓𝑡) ∑1𝑗=0𝑓 (𝑆𝑡+1| 𝑆𝑡= 𝑗) 𝑓 (𝑆𝑡= 𝑗 | 𝜓𝑡),

(41)

and then generate𝑆𝑡using 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 equal to the calculated value ofP(𝑆𝑡 = 1 | 𝑆𝑡+1, 𝜓𝑡), we set 𝑆𝑡 = 1, otherwise,𝑆𝑡is set equal to 0.

In view of applications, let us now consider the following

four state MSM:

𝑦𝑡∼ N (0, 𝜎𝑆2𝑡) , 𝑡 = 1, 2, . . . , 𝑇,

𝜎𝑆𝑡= 𝜎1𝑆1,𝑡+ 𝜎2𝑆2,𝑡+ 𝜎3𝑆3,𝑡+ 𝜎4𝑆4,𝑡,

𝑆𝑡∈ {1, 2, 3, 4} with transition probabilities 𝑝𝑖𝑗:= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖) , 𝑖, 𝑗 = 1, 2, 3, 4,

(42)

where𝑆𝑘,𝑡 = 1 if 𝑆𝑡 = 𝑘, otherwise 𝑆𝑘,𝑡 = 0. Note that this is a particular case of the model analysed inSection 2.1, where

(8)

𝜇𝑡 = 0 ∀𝑡, hence we can perform the procedure referred to serially uncorrelated data taking𝜇𝑆𝑡= 𝜇 = 0 to start the Gibbs sampling algorithm, therefore we have

Step 1. Generate ̃𝑆𝑇 := (𝑆1, 𝑆2, . . . , 𝑆𝑇) conditional on ̃𝜎2 :=

(𝜎2

1, 𝜎22, 𝜎32, 𝜎42),

̃𝑝 := (𝑝11, 𝑝12, 𝑝13, 𝑝21, 𝑝22, 𝑝23, 𝑝31, 𝑝32, 𝑝33, 𝑝41, 𝑝42, 𝑝43) ,

𝜓𝑇:= (𝑦1, 𝑦2, . . . , 𝑦𝑇) .

(43) For this purpose, we employ the Multi-move Gibbs sam-pling algorithm:

(1) run procedure inSection 2.1with𝜇𝑆𝑡 = 0 in order to get, from last iteration,𝑓(𝑆𝑇| 𝜓𝑇) = P(𝑆𝑇| 𝜓𝑇), (2) recalling that𝑓(𝑆𝑡| 𝑆𝑡+1, 𝜓𝑡) ∝ 𝑓(𝑆𝑡+1| 𝑆𝑡)𝑓(𝑆𝑡| 𝜓𝑡)

for𝑡 = 𝑇−1, . . . , 1, we can generate 𝑆𝑡from the vector of probabilities (P (𝑆𝑡= 1 | 𝑆𝑡+1, 𝜓𝑡) , P (𝑆𝑡= 2 | 𝑆𝑡+1, 𝜓𝑡) , P (𝑆𝑡= 3 | 𝑆𝑡+1, 𝜓𝑡) , P (𝑆𝑡= 4 | 𝑆𝑡+1, 𝜓𝑡)) , (44) where, for𝑖 = 1, . . . , 4, P (𝑆𝑡= 𝑖𝑆𝑡+1, 𝜓𝑡) = 𝑓 (𝑆𝑡+1𝑆𝑡= 1) 𝑓 (𝑆𝑡= 𝑖𝜓𝑡) ∑3𝑗=1𝑓 (𝑆𝑡+1𝑆𝑡= 𝑗) 𝑓 (𝑆𝑡= 𝑗𝜓𝑡). (45)

Step 2. Generatẽ𝜎2, conditional on ̃𝑆𝑇and the data𝜓𝑇.

We want to impose the constraint𝜎12 < 𝜎22< 𝜎23 < 𝜎42, so we redefine𝜎𝑆2𝑡in this way:

𝜎2𝑆𝑡= 𝜎21(1 + 𝑆2,𝑡2) (1 + 𝑆3,𝑡2) (1 + 𝑆3,𝑡3) × (1 + 𝑆4,𝑡2) (1 + 𝑆4,𝑡3) (1 + 𝑆4,𝑡4) ,

(46)

whereℎ𝑗 > 0 for 𝑗 = 1, . . . , 4, so that 𝜎22 := 𝜎12(1 + ℎ2), 𝜎32 := 𝜎2

1(1+ℎ2)(1+ℎ3) and 𝜎24 := 𝜎21(1+ℎ2)(1+ℎ3)(1+ℎ4). With this

specification, we first generate𝜎21, then generateℎ2 = 1 + ℎ2, ℎ3 = 1 + ℎ3 andℎ4 = 1 + ℎ4 to obtain𝜎22,𝜎32and𝜎24 indi-rectly.

Generating𝜎12, Conditional on2,3 and4. Define for𝑡 =

1, . . . , 𝑇

𝑌𝑡1:= 𝑦𝑡

√(1 + 𝑆2,𝑡ℎ2) (1 + 𝑆3,𝑡ℎ2) (1 + 𝑆3,𝑡ℎ3) (1 + 𝑆4,𝑡ℎ2) (1 + 𝑆4,𝑡ℎ3) (1 + 𝑆4,𝑡ℎ4) (47)

and take𝑌1𝑡 ∼ N(0, 𝜎21), in(42). By choosing an inverted

Gamma prior distribution, that is,𝑓(𝜎12 | ℎ2, ℎ3, ℎ4) ∼ IG(]1/

2, 𝛿1/2) where ]1, 𝛿1are the known prior hyperparameters, it can be shown that the conditional posterior distribution from which we generate𝜎12is given by:

𝜎12| 𝜓𝑇, ̃𝑆𝑇, ℎ2, ℎ3, ℎ4∼ IG (]1+ 𝑇

2 ,

𝛿1+ ∑𝑇𝑡=1𝑌1 𝑡

2 ) . (48)

Generating2 Conditional on𝜎21,3 and4. Note that the

likelihood function ofℎ2depends only on the values of𝑦𝑡for which𝑆𝑡 ∈ {2, 3, 4}. Therefore, take 𝑦𝑡(1) := {𝑦𝑡 | 𝑆𝑡 ∈ {2, 3, 4}, 𝑡 = 1, . . . , 𝑇} and denote with 𝑇2the size of this sample. Then define

𝑌𝑡2:= 𝑦𝑡(1)

√𝜎2

1(1 + 𝑆3,𝑡ℎ3) (1 + 𝑆4,𝑡ℎ3) (1 + 𝑆4,𝑡ℎ4)

, (49) hence, for the observation in which𝑆𝑡 = 2, 3 or 4, we have 𝑌2𝑡∼ N(0, ℎ2). If we choose an inverted Gamma distribution

with parameters]2, 𝛿2 for the prior, we obtainℎ2 = 1 + ℎ2 from the following posterior distribution:

2| 𝜓𝑇, ̃𝑆𝑇, 𝜎12, ℎ3, ℎ4∼ IG (]2+ 𝑇2

2 ,

𝛿2+ ∑𝑇2

𝑡=1𝑌𝑡2

2 ) . (50)

In caseℎ2> 1 put ℎ2= ℎ2−1 and 𝜎22:= 𝜎21(1+ℎ2). Otherwise reiterate this step.

Generating3 Conditional on𝜎21,2 and4. Operate in a

similar way as above. In particular if we define𝑦𝑡(2) := {𝑦𝑡 | 𝑆𝑡∈ {3, 4}, 𝑡 = 1, . . . , 𝑇} we will obtain 𝑌𝑡3:= 𝑦𝑡(2) √𝜎2 1(1 + 𝑆3,𝑡ℎ2) (1 + 𝑆4,𝑡ℎ2) (1 + 𝑆4,𝑡ℎ4) ∼ N (0, ℎ3) . (51)

Generating4 Conditional on𝜎21,2 and3. Operate in a

similar way as above. In particular if we define𝑦𝑡(3) := {𝑦𝑡 | 𝑆𝑡= 4, 𝑡 = 1, . . . , 𝑇} we will have

𝑌𝑡4:= 𝑦𝑡(3)

√𝜎2

1(1 + 𝑆4,𝑡ℎ2) (1 + 𝑆4,𝑡ℎ3)

∼ N (0, ℎ4) . (52)

Step 3. Generatẽ𝑝 conditional on ̃𝑆𝑇. In order to generate the

transition probabilities we exploit the properties of the prior

Beta distribution. Let us first define

𝑝𝑖𝑖:= P (𝑆𝑡 ̸= 𝑖 | 𝑆𝑡−1= 𝑖) = 1 − 𝑝𝑖𝑖, 𝑖 = 1, 2, 3, 4; 𝑝𝑖𝑗:= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖, 𝑆𝑡 ̸= 𝑖) , 𝑖 ̸= 𝑗. (53)

(9)

Hence we have that

𝑝𝑖𝑗:= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖)

= P (𝑆𝑡= 𝑗 | 𝑆𝑡−1= 𝑖, 𝑆𝑡 ̸= 𝑖) P (𝑆𝑡 ̸= 𝑖 | 𝑆𝑡−1= 𝑖) = 𝑝𝑖𝑗(1 − 𝑝𝑖𝑖) ∀𝑖 ̸= 𝑗.

(54)

Given ̃𝑆𝑇, let𝑛𝑖𝑗,𝑖, 𝑗 = 1, 2, 3, 4 be the total number of tran-sitions from state𝑆𝑡−1= 𝑖 to 𝑆𝑡= 𝑗, 𝑡 = 2, 3, . . . , 𝑇 and 𝑛𝑖𝑗the number of transitions from state𝑆𝑡−1= 𝑖 to 𝑆𝑡 ̸= 𝑗.

Begin with the generation of probabilities𝑝𝑖𝑖,𝑖 = 1, 2, 3, 4 by taking the Beta distribution as conjugate prior: if we take 𝑝𝑖𝑖∼ Beta(𝑢𝑖𝑖, 𝑢𝑖𝑖), where 𝑢𝑖𝑖and𝑢𝑖𝑖are the known

hyperpara-meters of the priors, the posterior distribution of𝑝𝑖𝑖given ̃𝑆𝑇 still belongs to the Beta family distributions, that is,

𝑝𝑖𝑖| ̃𝑆𝑇∼ Beta (𝑢𝑖𝑖+ 𝑛𝑖𝑖, 𝑢𝑖𝑖+ 𝑛𝑖𝑖) , 𝑖 = 1, 2, 3, 4. (55) The others parameters, that is,𝑝𝑖𝑗for𝑖 ̸= 𝑗 and 𝑗 = 1, 2, 3, can be computed from the above equation𝑝𝑖𝑗 = 𝑝𝑖𝑗(1 − 𝑝𝑖𝑖), where 𝑝𝑖𝑗 are generated from the following posterior Beta distribution:

𝑝𝑖𝑗| ̃𝑆𝑇∼ Beta (𝑢𝑖𝑗+ 𝑛𝑖𝑗, 𝑢𝑖𝑗+ 𝑛𝑖𝑗) . (56) For example, given that𝑝11is generated, we can obtain𝑝12 and𝑝13by considering

𝑝12| ̃𝑆𝑇∼ Beta (𝑢12+ 𝑛12, 𝑢12+ 𝑛12) ,

𝑝13| ̃𝑆𝑇∼ Beta (𝑢13+ 𝑛13, 𝑢13+ 𝑛13) , (57) where𝑛12= 𝑛13+𝑛14and𝑛13= 𝑛12+𝑛14. Finally, given𝑝11,𝑝12 and𝑝13generated in this way, we have𝑝14 = 1−𝑝11−𝑝12−𝑝13.

Remark 2. When we do not have any information about

priors distribution we employ hyperparameters 𝑢𝑖𝑗 = 0.5, 𝑖, 𝑗 = 1, 2, 3, 4. Usually we know that elements of the matrix diagonal in the transition matrix are bigger than elements out of the diagonal, because in a financial framework regime switching happens only occasionally: in this case, since we want𝑝𝑖𝑖close to 1 and𝑝𝑖𝑗,𝑖 ̸= 𝑗, close to 0, we will choose 𝑢𝑖𝑖bigger than𝑢𝑖𝑖.

4. Goodness of Fit

Since financial time series are characterized by complex and rather unpredictable behavior, it is difficult to find, if there is any, a possible pattern. A typical set of techniques which allow to measure the goodness of forecasts obtained by using a certain model, is given by the residual analysis. Let us suppose that we are provided with a time series of return observations {𝑦𝑡}𝑡=1,...,𝑇,𝑇 ∈ N+, for which we choose, for example, the

model described in(4)with𝑀 = 4. By running the procedure ofSection 2.1we obtain the filtered probabilities

P (𝑆𝑡= 𝑗 | 𝜓𝑡) , 𝑗 = 1, 2, 3, 4, 𝑡 = 1, . . . , 𝑇, (58) and, by maximization of the log-likelihood function, we compute the parameters ̂𝜇1, . . . , ̂𝜇4, ̂𝜎1, . . . , ̂𝜎4, therefore we

can estimate both the mean and variance of the process at time𝑡, for any 𝑡 = 1, . . . , 𝑇, given the information set 𝜓𝑡as weighted average of four values:

̂𝜇𝑡:= E (𝜇𝑡| 𝜓𝑡) := ̂𝜇1P (𝑆𝑡= 1 | 𝜓𝑡)

+ ⋅ ⋅ ⋅ + ̂𝜇4P (𝑆𝑡= 4 | 𝜓𝑡) , ̂𝜎𝑡2:= E (𝜎𝑡2| 𝜓𝑡) := ̂𝜎12P (𝑆𝑡= 1 | 𝜓𝑡)

+ ⋅ ⋅ ⋅ + ̂𝜎42P (𝑆𝑡= 4 | 𝜓𝑡) .

(59)

If the chosen model fits well the data, then the standardized residuals will have the following form:

̂𝜖𝑡=𝑦𝑡− ̂𝜇𝑡

̂𝜎𝑡 ∼ N (0, 1) , 𝑡 = 1, . . . , 𝑇, (60)

therefore it is natural to apply a normality test as, for example, the Jarque-Bera test (see [18]) for details. We recall briefly that Jarque-Bera statistics is defined as

JB:= 𝑇 6 (𝑆2−

1

4(𝐾 − 3)2) , (61) where the parameters𝑆 and 𝐾 indicate the skewness, respec-tively, the kurtosis of̂𝜖𝑡. If̂𝜖𝑡come from a Normal distribu-tion, the Jarque-Bera statistics converges asymptotically to a chi-squared distribution with two degrees of freedom, and can be used to test the null hypothesis of normality: this is a joint hypothesis of the skewness being zero and the excess kurtosis(𝐾 − 3) being also zero.

Remark 3. Note that the Jarque-Bera test is very sensitive

and often rejects the null hypothesis only because of a few abnormal observations, this is the reason why, one has to take point out these outliers which has to be canceled out before apply the test on the obtained smoothed data.

5. Prediction

The forecasting task is the most difficult step in the whole MSM approach. Let us suppose that our time series ends at time𝑇 ∈ N+, without further observations, then we have to start the prediction with the following quantities:

(i) the transition probability matrix𝑃∗:= {𝑝𝑖𝑗}𝑖,𝑗=1,2,3,4; (ii) the vector 𝜋𝑇 := P(𝑆𝑇 | 𝜓𝑇) = (P(𝑆𝑇 = 1 |

𝜓𝑇), . . . , P(𝑆𝑇 = 4 | 𝜓𝑇)) obtained from the last iteration of the filter algorithm, for example, the procedure inSection 2.1.

It follows that we have to proceed with the first step of the filter procedure obtaining the one-step ahead probability of the state𝑆𝑇+1given the sample of observations𝜓𝑇, that is,

P (𝑆𝑇+1= 𝑗 | 𝜓𝑇) =∑4

𝑖=1

𝑝𝑖𝑗P (𝑆𝑇= 𝑗 | 𝜓𝑇) , 𝑗 = 1, 2, 3, 4. (62) Equation (62) can be seen as a prediction for the regime at time𝑇 + 1, knowing observations up to time 𝑇. At this

(10)

point, the best way to make prediction about the unobserved variable is the simulation of further observations. Indeed, with the new probability P(𝑆𝑇+1 | 𝜓𝑇) and the vector of parameter estimates ̂𝜃 := (̂𝜇1, . . . , ̂𝜇4, ̂𝜎1, . . . , ̂𝜎4) we can estimate the one step ahead mean and variance as follows:

̂𝜇𝑇+1:= E (𝜇𝑇+1| 𝜓𝑇) := ̂𝜇1P (𝑆𝑇+1= 1 | 𝜓𝑇) + ⋅ ⋅ ⋅ + ̂𝜇4P (𝑆𝑇+1= 4 | 𝜓𝑇) , ̂𝜎2 𝑇+1:= E (𝜎2𝑇+1| 𝜓𝑇) := ̂𝜎12P (𝑆𝑇+1= 1 | 𝜓𝑇) + ⋅ ⋅ ⋅ + ̂𝜎42P (𝑆𝑇+1= 4 | 𝜓𝑇) . (63) Then we simulate ̂𝑦𝑇+1by the Gaussian distributionN(̂𝜇𝑇+1, ̂𝜎𝑇+1) and, once ̂𝑦𝑇+1 has been simulated, we defe𝜓𝑇+1 := {𝑦1, . . . , 𝑦𝑇, ̂𝑦𝑇+1}. Then we first apply again the filter proce-dure ofSection 2.1for𝑡 = 𝑇 + 1 in order to obtain P(𝑆𝑇+1 | 𝜓𝑇+1), then we compute P(𝑆𝑇+1 | 𝜓𝑇+1), ̂𝜇𝑇+2and ̂𝜎𝑇+22 , and

we simulatê𝑦𝑇+2by the Gaussian distributionN(̂𝜇𝑇+2, ̂𝜎𝑇+2). Latter procedure runs the same all the other rime-steps𝑇 + 3, . . . , 𝑇+𝑚, where 𝑚 ∈ N+is the time horizon of our forecast.

Remark 4. We would like to underline that latter described

method is not reliable with few simulations since each𝑦𝑇+𝜏, for𝜏 = 1, . . . , 𝑚 may assume a wide range of values and a single drawn describes only one of the many possible paths. So we can think to reiterate previous strategy many times in order to compute the mean behavior ofP(𝑆𝑇+𝜏 | 𝜓𝑇+𝜏), ̂𝜇𝑇+𝜏and̂𝜎𝑇+𝜏. After having obtained a satisfactory number of

data, then we can construct a confidence interval within the state probability will more likely take value. Obviously a high number of iterations of latter procedure rapidly increases the computational complexity of the whole algorithm because of the MLE related computational complexity, therefore we will adopt a rather different strategy which consists in simulating 𝑦𝑇+𝜏 𝑁 times at each step (e.g., 𝑁 = 10000) and then taking the mean over those values. However, we must pay attention because the mean calculation could cancel the possible regime switching: for example, if we draw many times𝑦𝑡fromN(0, 𝜎𝑆𝑡) and we take the mean, by the law of large number we will have zero at any time. To overcome this problem we can take the mean of absolute values and then multiply this mean by a number𝑥, which is a random variable that takes values 1 or−1, with equal probability, hence deciding the sign of𝑦𝑡at every simulation step.

6. Applications

In this section we are going to apply the classical inference approach for a MSM to analyse real financial time series. In particular we will first examine data coming from the Standard & Poor’s 500 (S&P 500) equity index which is con-sidered, being based on the 500 most important companies in the United States, as one of the best representations of the U.S. stock market. Secondly, we shall consider the DAX (Deutsche Aktien Index) index which follows the quotations of the 30 major companies in Germany. Our choice is motivated by

a twofold goal: first we want to test the proposed 4-states MSM model on two particularly significant indexes which have shown to incorporate abrupt changes and oscillations, secondly we aim at comparing the behaviour of the two indexes between each other.

Computations have been performed following the MSM approach described in previous section, namely exploiting the procedures illustrated inSection 2. Let us underline that, instead of a standard 3-states MSM model, we shall use a 4-states MSM approach both for the S&P 500 and the DAX returns. Moreover the analysis has been realized for different intervals of time, focusing mainly on the period of Global Financial Crisis.

6.1. The S&P 500 Case. Figure 1 reports the graph of the

Standard & Poor’s 500 from 1st June 1994 to 27th May 2014, and it points out the dramatic collapse of index prices in years 2008-2009, when the crisis blowed-up causing the achievement, 6th of March 2009 with 683.38 points, of the lowest value since September 1996.

Because of the latter fact we decided to focus our analysis on recent years. In particular we take into account data starting from the 1st of June 2007, and until 27 May 2014, therefore, denoting withΛ the set of observations and with 𝑋𝑡,𝑡 ∈ Λ, the price data of the S&P 500, returns are calculated as usual by𝑦𝑡 := (𝑋𝑡− 𝑋𝑡−1)/𝑋𝑡−1,𝑡 ∈ Λ, where {𝑦𝑡}𝑡∈Λ are the values for which we want to choose the best MSM. Note that in our implementation we grouped the daily data into weekly parcels in order to make the filter procedures less time-consuming and have a more clear output, therefore we obtain a vector of 365 values, still denoted by𝑦𝑡, as shown in

Figure 2.

Next step consists in understand if the returns are serially correlated or serially uncorrellated, a taks which can be accomplished by running some suitable test, for example, the Durbin-Watson test (see, for example, [19,20] or [7]) com-puting directly the value of the autoregressive parameter𝜙 by least square methods, namely𝜙 := (∑𝑡∈Λ𝑦𝑡𝑦𝑡+1)/(∑𝑡∈Λ𝑦𝑡2), which gives us a rather low value, that is,−0.0697, so that we can neglect the autoregressive pattern and start the analysis by considering S&P 500 returns to be generated by a Gaussian distribution with switching mean and variance, that is,

𝑦𝑡= 𝜇𝑆𝑡+ 𝜖𝑡, 𝑡 ∈ Λ {𝜖𝑡}𝑡∈{1,...,𝑇} are i.i.d. N (0, 𝜎2𝑆𝑡) , 𝜇𝑆𝑡= 𝜇1𝑆1,𝑡+ ⋅ ⋅ ⋅ + 𝜇4𝑆4,𝑡, 𝜎𝑆𝑡= 𝜎1𝑆1,𝑡+ ⋅ ⋅ ⋅ + 𝜎4𝑆4,𝑡, 𝑆𝑡∈ {1, . . . , 4} with probabilities 𝑝𝑖𝑗, (64)

where for(𝑘, 𝑡) ∈ {1, . . . , 4} × Λ we have 𝑆𝑘,𝑡 = 1 if 𝑆𝑡 = 𝑘, otherwise 𝑆𝑘,𝑡 = 0. Therefore, we suppose that the state variable𝑆𝑡,𝑡 ∈ Λ, takes its values in the set Ω := {1, 2, 3, 4}, and we expect that the probabilities of being in the third and fourth state increase as a financial crisis occurs. Exploiting the procedure provided inSection 2.1, with respect to the returns

(11)

17-May-1994400 19-Jan-2001 24-Sep-2007 29-May-2014 600 800 1000 1200 1400 1600 1800 2000 S&P500

Figure 1: Daily observations of S&P 500 from 1994 to 2014.

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

0 0.05 0.1 0.15

Weekly returns S&P500 −0.2

−0.15 −0.1 −0.05

Figure 2: Daily returns of S&P 500 from 2007 to 2014.

𝑦𝑡,𝑡 ∈ Λ = {1, . . . , 365}, we get the results shown in Figures3

and4.

Let us now consider the estimated standard deviation ̂𝜎𝑡:= E (𝜎𝑡| 𝜓𝑡) := ̂𝜎1P (𝑆𝑡= 1 | 𝜓𝑡)

+ ⋅ ⋅ ⋅ + ̂𝜎4P (𝑆𝑡= 4 | 𝜓𝑡) , 𝑡 ∈ Λ, (65) which we want to compare with the VIX index, also known as the Chicago Board Options Exchange (CBOE) market volatility index, namely one of the most relevant measure for the implied volatility of the S&P 500 index, whose value used by our analysis are reported inFigure 5.

What we obtain by plotting both estimated volatility and VIX values in the same graph can be seen inFigure 6, where the VIX trend is plotted in red, while we have used the blue color for the conditional standard deviation values.

Note that, in order to have values of the same order, each ̂𝜎𝑡, 𝑡 ∈ Λ, has been multiplied by a scale factor equal to

1000. We would like to point out how the estimated standard deviation accurately approximates the VIX behaviour, hence allow us to count on an effective substitute for the volatility of the S&P 500, at least during a relative nonchaotic period. In fact we also underline that the greater discrepancies between real and simulated values appears during the maximum intensity period of the recent financial crisis. In particular the widest gaps are realized in correspondence with the recession experienced at the end of 2008.

In what follows we study how latter evidence influences the global goodness of the realized analysis. In particular we performed a goodness of fit analysis computing the standardized residuals of the proposed MSM bŷ𝜖𝑡 := (𝑦𝑡− ̂𝜇𝑡)/̂𝜎𝑡,𝑡 ∈ Λ, where 𝑦𝑡is the observation of S&P 500 return

at time𝑡, ̂𝜇𝑡is the estimated conditional mean, and̂𝜎𝑡is the standard deviation. If the model is a good fit for the S&P 500 return, standardized residuals will be generated by a standard Gaussian distribution. In Figures7and8, we have reported both the histogram, its related graph, and the so called normal

probability plot (NPP) for the standardized residuals.

Let us recall that the purpose of the NPP is to graphically assess whether the residuals could come from a normal distribution. Indeed, if such a hypothesis holds, then the NPP

has to be linear, namely the large majority of the computed

values, that is, the blue points inFigure 8, should stay close to a particular line, which is the red dotted one inFigure 8, which is the case in our analysis apart from the three points in the left-hand corner of the graph, which correspond to the minimal values of the vector of standardized residuals.

Applying two normality tests on {̂𝜖𝑡}𝑡∈Λ, that is, the

Jarque-Bera test and (see, for example, [21, pag. 443]) the

Lilliefors test, we have that the null hypothesis of normality

for the standardized residuals can be rejected at the 5% level, unless the previous pointed out outliers are removed. Indeed if the two minimal standardized residuals, corresponding to ̂𝜖71 = −3.8441 and ̂𝜖153 = −3.6469, are cancelled out from the vector{̂𝜖𝑡}𝑡∈Λ, previously cited tests indicate that the

(12)

0 50 100 150 200 250 300 350 400 0 State 1 0 50 100 150 200 250 300 350 400 0 State 2 0 50 100 150 200 250 300 350 400 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 State 3 0 50 100 150 200 250 300 350 400 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 State 4

Figure 3: Filtered probabilitiesP(𝑆𝑡= 𝑘 | 𝜓𝑡) for 𝑡 ∈ Λ, 𝑘 ∈ {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 400 0 0.05 0.15 0.25 0.35 0 50 100 150 200 250 300 350 400 0 State 1 State 2 State 3 0.1 0.1 0.2 0.2 0.3 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 State 4

(13)

17-May-19940 19-Jan-2001 24-Sep-2007 29-May-2014 10 20 30 40 50 60 70 80 90 VIX

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

0 50 100 150 200 250 300 350 400 10 20 30 40 50 60 70 80 VIX index Estimated volatility

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

0 50 100 150 200 250 300 350 400 0 1 2 3 4 Standardized residuals −1 −1 −2 −2 −3 −3 −4 −4 0 1 2 3 4 0 20 40 60 80 100 120

Figure 7: Plot and histogram of standardized residuals.

hypothesis of normality, at the same significance level of5%, cannot be rejected. In particular, the Jarque-Bera statistics value is JB = 2.7858 with corresponding 𝑃-value 𝑃JB =

0.2153, and the critical value for this test, that is, the max-imum value of the JB statistics for which the null hypothesis cannot be rejected at the chosen significance level, is equal to𝑘JB = 5.8085. Similarly, with regard to the Lilliefors test,

numerical value of Liellifors statistics,𝑃-value and critical value are respectively given by𝐿 = 0.0424, 𝑃𝐿 = 0.1181 and 𝑘𝐿= 0.0472.

In 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 volatilitŷ𝜎𝑡,𝑡 ∈ Λ on a time horizon of two months, hence8 steps ahead, then simulations have been performed according to Remark 4, with𝑁 = 15000, 𝑇 = 365, 𝜏 = {1, 2, . . . , 8}, and 𝑥 uniformly distributed in{−1, 1}. Obtained forecasting results are shown inFigure 9, where plots are referred to the observations from the 300th to the 373rd, with the last8 simulated values within red rectangles.

6.2. The DAX Case. In what follows the proposed 4-state

MSM shall be applied to analyse the Deutsche Aktien Index (DAX) stock index during a shorter, compared to the study

(14)

0 1 2 3 0.001 0.0030.01 0.02 0.05 0.10 0.25 0.50 0.75 0.90 0.95 0.98 0.99 0.997 0.999 Data Prob abi lit y

Normal probability plot

−1 −2 −3 −4

Figure 8: Normal probability plot of standardized residuals.

0 10 20 30 40 50 60 70 80 0 0.01 0.02 0.03 Forecasted returns −0.01 −0.02 −0.03 (a) 0 10 20 30 40 50 60 70 80 0.0156 0.0158 0.016 0.0162 0.0164 0.0166 0.0168 0.017 0.0172 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

0 0.05 0.1 0.15 0.2

Weekly returns DAX −0.2

−0.25

−0.15−0.1

−0.05

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

made in Section 6.1, time interval, indeed we take into account data between the 1st of January 2008 and until the 1st of January 2011. Such a choice is motivated by the will of concentrate our attention on the most unstable period, that for the DAX index starts with the abrupt fall experienced by the European markets at the beginning of 2008. We underline that, with respect to the considered time period, the estimated autoregressive coefficient for the DAX index is a bit higher, in absolute value, than the one obtained for the S&P 500 index, indeed ̂𝜙DAX = −0.1477 versus ̂𝜙S&P500= −0.0697, so that we

decided to fit the weekly DAX returns with an autoregressive

pattern using the procedure inSection 2.2and according to the following MSM: 𝑦𝑡= 𝜙 (𝑦𝑡−1) + 𝜖𝑡, 𝑡 ∈ Λ {𝜖𝑡}𝑡∈{1,...,𝑇} are i.i.d. N (0, 𝜎2𝑆𝑡) , 𝜎𝑆𝑡= 𝜎1𝑆1,𝑡+ ⋅ ⋅ ⋅ + 𝜎4𝑆4,𝑡, 𝑆𝑡∈ {1, . . . , 4} with probabilities 𝑝𝑖𝑗, (66)

(15)

0 20 40 60 80 100 120 140 160 00 20 40 60 80 100 120 140 160 0.05 0.15 0.25 0.35 0 20 40 60 80 100 120 140 160 0 0.05 0.15 0.25 0.35 0.45 0 20 40 60 80 100 120 140 160 0 State 1 State 2 State 3 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.1 0.2 0.2 0.3 0.3 0.4 0.4 0.5 0.6 0.7 0.8 0.9 1 State 4 0.1 0.2 0.3

Figure 11: Filtered probabilitiesP(𝑆𝑡= 𝑘 | 𝜓𝑡) for 𝑡 ∈ Λ, 𝑘 ∈ {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 00 20 40 60 80 100 120 140 160 State 1 State 2 State 3 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.8 0.9 1 State 4

Riferimenti

Documenti correlati

Socio- demographic and clinical characteristics were recorded; dysfunctional eating was tested by vali- dated questionnaires (Eating Attitude Test-EAT-26, Binge Eating Scale-BES;

dechlorination of PCDDs, PCDFs, and coplanar PCBs using metallic 294. calcium in ethanol under atmospheric pressure at room

persicae, is in accordance with previous data attesting that, in Italy, esterase insecticide resistance is based on FE4 amplification and, at least in the recent past, has proved

Rispettivamente, il Regno Unito gli investimenti in ricerca ed il trasferimento tecnologico, il Cile il sostegno all’im- prenditorialità, Israele la valorizzazione

A complete overview of main targets, key interactions, scores and policy options to reach integrated vector management for dengue control are provided in Table 1.. Prevention of

Digitalis Investigation Group trial (DIG) [A] and the Systolic Heart failure treatment with the I f inhibitor Ivabradine Trial

But suppose now there is a change in taxes, and from my current income level, my marginal 211 Taxes, Transfers, Labor Supply and Household Welfare... tax is lowered to 20

Nor can one overlook the fact that Vander at times speaks borrowing Nietzsche’s voice, such as in “where lust and its easements are concerned I am and always was beyond