post list
QuantDare
categories

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

asset management

El filtro de Kalman

J. González

There are some things impossible to quantify. How delicious are your mom’s cookies or how exciting is to train a neural network, for example. But financial markets are made of numbers – among other things. They should be measurable, quantifiable. Nobody said it was easy. But we dare.

Markov Switching Regimes say… bear or bullish?

mplanaslasa

09/06/2016

We continue with our last OBSSESION…

trying to capture an index trend while at the same time, not playing with future information.

We are going to introduce the Markov Switching Regimes (MSR) model which, as its name indicates, tries to capture when a regimen has changed to another one. This may be a change between opposite trends, or it could consist in passing from “being in trend” to “not being  in trend” and vice versa.

Markov could sound familiar to some of you, as j3 introduced Markov chains a couple of years ago. The main characteristic of this stochastic process is that in a stage t, the probability of occurrence only depends on what happened in the immediately previous stage, t-1. In our post we will assume that the trend of an index today will depend only on which trend was living yesterday. This means the index will be governed by a Markov chain. In particular, our Markov chain will be formed by two possible stages; bullish and bearish trends. Both will constitute the regimes modelled and predicted by MSR models.

Two regimes described by two stock indexes

Our interest is to classify trends, particularly trends of Standard and Poor’ s 500 Index and for this purpose, we will define two regimes based in the causality between Euro Stoxx 50 and Standard and Poor’s 500:

rSPX,t =  a+ b* rSTX,t + ek,t  ,    k=1,2 (= two possible values of the states S)

You will probably be asking “why haven’t you used only the Standard and Poor’s 500 as an explicative variable”? In fact, I have tried to estimate an AR model in which the explicative variable is Standard and Poor’s 500 itself with one (or more) lag(s) shifted from the endogenous variable. However, the fitting is not good enough, as my colleague psanchezcri showed in his last post. This is the reason why I decided to try the use of models mixing S&P 500 and Euro Stoxx 50. In fact, this relationship worked out not bad in my last post.

How does MSR process work?

Let’s call pij the probability to be in the regime i at time t and come to regime j at t+1, this is called the conditional probability. Remember again that the probability to be at t+1 in some state is conditioned to the states which have lived in t, t-1,t-2,t-3… depends only on what happened on t because we are supposing our process to be a Markov Chain:

P(St = i |St-1 = j, St-2 = k, St-3 = l,…) = P(St = i |St-1 = j) = pij

Starting to explain all the details of MSR method with pure formalism would be tedious, so for more information I strongly recommend you read the famous book of Hamilton (Time series analysis, chapter 22 (1994)) to learn how this process works and how we can use both probabilities pij and the regression estimate between Euro Stoxx 50 and Standard and Poor’s in order to get the series of historic unconditional probabilities at every step t:

Unconditional Probability (t) = p ( St = x | all information known at time t)
x = 1 (bullish) or 2 (bearish)

But do we already know that these regimes will match with a trend classification?

The most important aspect you must keep in mind is “a priori”; we can’t force one regime to be exactly the bullish or bearish one. This method will return a classification of our series and we will check that it fits with a trend’s classification. So if we talk about a bullish (bearish) regime, notice that despite this name, we already don’t know if the final classification will be the trend classification we want to get.  However, we can guide the models estimate to have “characteristics” that suit with an up/down trends…but how do we get this?

1.  One idea: force the regimes to have constants with different signs (an easy way to get this is taking proper transformations of these constants and once the estimate is done, undo the transformations). The idea is that the regime with positive constant could describe upward trends, while the other could describe downward ones.
2. Another idea: the experience shows us that uptrends are longer and more “clear” (with less contrarian movements against the sense of the trend) so our initial value set for will be 95%  (supposing that 1=uptrend) but for the other regime we set 70% as its initial probability condition. This means that we are esstablishing that continuing in a bullish regime is much more likely to happen than in a bearish trend and vice versa: moving out from a bearish trend is more likely to happen than in an uptrend one.

And once the estimate is obtained… how is our bet?

Once we have the time series estimate of the unconditional probabilities, one regime with positive constant and negative for the other, we set the next rule in order to bet:
“if one of the probabilities is above 70% (so the other is below 30%) we bet for this sense of trend (bullish or bearish, depending on which probability has the higuer value). If this does not occur, we don’t bet for trend so we figure that the state for the index is ranged marked”.

We have applied this, and the coincidence with a method that cheats classifying trends using information unknown at the time is …

…54%.

Despite the fact that we show a light bias in favour of success-predicting trends, we find this method not very robust as we have checked that a little change of the initial values of the probabilities generates different results. For example, if we increase the conditional value given to the transition probability of the regime we want to be the bearish one (set as 70%, as we have already mentioned), the series of unconditional probabilities obtained are not very reliable, as they show jumps in the frequencies of their values:

Another aspect that makes this result unreliable is that we were expecting to see less S&P 500 volatility in the regimen assumed to be the bullish one and the opposite in the bearish, but this does not occur with high constancy. See below:

To conclude

To continue trying this technique, we should look for extensions of this method. What about increasing the number of states or describing the regimes with other models? We will continue looking for one version with better results than those obtained in this post. See you next time!