Modern Probability Theory For Stock Traders

Today so much advanced mathematics is being used by the Quants you will find it very difficult to understand their trading strategies. Most of them use advanced stochastic calculus in their mathematical models. When you try to understand their trading strategies you just scratch your head as you have no idea what the mathematical formulas mean. After a few pages of very advanced mathematics you find the whole trading strategy programmed in either Python, Java or C++. So everything is impossible to understand. But I made a decision last year. I will understand their maths and learn how they use stochastic calculus in modelling the markets. I have made quite a progress now in my understanding of stochastic calculus. Understanding stochastic calculus is really challenging. This is something I learned while struggling in the beginning. The books love to throw mathematics at you like you are a great mathematician. But it is a journey worth undertaking. Did you read my post how to price stock options using R?

Binomial Pricing Model

The stochastic calculus journey starts with your brush with probability space, measure space and lebesgue integral. If you can cross this hurdle, the road is clear for you. After that you can learn stochastic calculus and may as well apply to a big hedge fund for job as a quant. I am not joking. Quants are earning very high salaries as high as $400K. You can read this article that says big banks and hedge funds are enticing new PhDs in mathematics with high salaries to become etraders. Algorithmic trading is the way forward. This the future. If you are a retail trader, your days are over. Mathematics now rules the markets. Mathematical models of financial models heavily depend on modern probability theory and stochastic calculus especially if you want to understand the famous Black Scholes Merton Options Pricing formula which is just the start. Once you understand that you will understand many high frequency trading strategies as well as low frequency trading strategies. Today mathematical research is being driven by the needs of these financial models and stochastic partial differential equations are being used a lot by the quants employed at Wall Street. Learning modern probability theory is not difficult so let’s start. Doing fundamental analysis is very important in stock trading. Read the post on how to do fundamental analysis using R.

Uncertainty is part of our life. Financial markets are highly uncertain. We can only talk of possible scenarios. There are many things that impact upon the financial market. Modern financial markets are totally being driven by the sentiment and the breaking news. Modern mathematical models of financial markets cater for these things so they are being used a lot in algorithmic trading. Mathematical models of market volatility are now pretty advanced and ca give results. Before 2008, quants made a number of foolish assumptions like using the normal distribution in modelling the risk. This foolish assumption became popular and people starting believing that normal Gaussian distribution works in the financial market. But these models failed miserably in the 2008 stock market crash. Why? Stock market is heavy tailed. It is not normally distributed. So most of the time we can find big returns while the normal modelling cannot predict big returns that lie in the tails. After getting their fingers burnt, now quants don’t use normal distribution. Rather they pay a lot of attention to the extreme value theory when making their financial models. Over the next few months, I will write a series of posts that will explain stochastic calculus to you in simple terms so keep on checking. Learn how to get paid buying your favorite stock.

We need to start with the modern theory of probability. We need a mathematical rigorous definition of probability. If you have taken an introductory course on probability, you will remember how to calculate the probability of a die. It has six sides and each side is equally likely so we say the probability of 1,2,3,4,5,6 is just 1/6. Let’s formalize it with the concept of a probability space. Financial markets are characterized by the uncertainty about the future prices of stocks, currencies, commodities, interest rates or stock indices. We need to build probability models that evolve over time that we can use to predicting stock prices or for that matter commodity or currency prices. Probability theory started in an attempt to better explain the outcomes in gambling and today it is still being used in Casinos. We borrow the probability theory mathematical models and apply them in different areas that includes financial markets.

Lets start with a simple example. Current stock price that we call the spot price is $10 per share. We want to know the price of this stock ABC after 4 hours. We make a simple model. We suppose that ABC stock price jumps in price increments of $0.5 after every 15 minutes. It can either jump up or down. So after 15 minutes, ABC stock price can be $10.5 or $9.5. After 30 minutes, it can be $11 if it jumps up two times or $9 if it jumps down two times or it can be $10 if it jumps up then jumps down or it jumps down then jumps up. After 4 hour we would have 16 jumps and the price can range between $10+$8=$18 if it jumps up 16 times which is highly unlikely but this will be the maximum price. The minimum would be if it jumps down 16 times and the price would be just $10-$8=$2. So after 4 hours stock ABC price will be ranging between $2 to $18 with many possibilities in between. Now this was a simple probability model. If we increase the time to 10 hours, you will see stock price can go down and become negative which is simply impossible as the lowest it can go is $0. So we need a better probability model.

The set of all possible outcomes is known as the sample space. In this example the set of outcomes is the stock price. When we start we have a known price which is $10. After 15 minutes, we have two possibilities $10.5 and $9.5 so our sample space is the set {9.5, 10.5}. After 30 minutes our sample space is {$9, $10, $11}. After 4 hours we will have the sample space (2,…..,18}. After 10 hours the sample space will be {-10,…..,30}. Keep this in mind. Sample space is just the set of all the possible outcomes. So after 10 hours, if the price jumps down at each step which is a possible outcomes, it becomes negative and we have the possibility of stock price becoming -$10 which is simply not possible. As I had pointed out we don’t have a good probability model. We need better model. Now you know what a sample space is. Let’s define sample space formally below!

The set of all possible outcomes is called the Sample Space and we denote it with Ω. The elements of Ω will be denoted by ω. As said above after two jumps we have Ω={9,10,11}. After 10 hours, we have 40 jumps assuming a jump after every 15 minutes and the sample space is Ω={-10, -9.5, ….., 29.5, 30}. Important question is what is the probability of a subset A ⊂ Ω. We denote it with P(A). Probability is a function from subsets A to the real interval [0,1]. Probability of Ω is 1 i.e P(Ω)=1 and P(∅) = 0 where ∅ is the null set. Probability of an elementary event is P(ω) and the probability of any event which is composed of a number of elementary events is just the sum of the probability of those events. Just like the case of tossing a die in which we assigned an equal probability of 1/6 to all the six elementary events we can also assign equal probability to the three elements 9,10, 11. We can also argue that assigning equal probability is not a good idea. We can arrive at price $10 by two ways instead of one so we have to assign it more weight meaning giving it 1/2 probability and giving 9 and 10 probability 1/2. Keep this in mind the probabilities in a sample space should add up to 1. This follows from our axiom P(Ω)=1. Did you take a look at my course Econometrics for Traders. In this course I show how to develop volatility models using econometrics.

Now as I said above, our model is not good. By making the stock price jump in ticks of ±0.50 we will have negative stock prices after sufficient number of jumps. In our case we will have possible negative stock prices after 10 hours. So we need to change our model a bit. Let’s do that now. Instead of making the stock price jump in ticks of ±0.50 we make the stock price jump in percentages of 1%. So the stock price can either jump up or down by 1% percentage point. Ω = {ωn : n = 0, 1, 2,…, 19, 20} after 20 jumps, with ωn = 10×1.01**n ×0.99**20−n. So by changing our model we have ensured that we don’t have negative stock prices. We can also choose probabilities using the binomial formula 20!/ n!(20−n)! (you should be familiar with the factorial notation). So after N jumps we have the probability assigned to each element in the sample space as P=N! /n!(N−n)! *2**(-N).

This stock trading probability model is also not good as it restricts how many jumps we have in a certain time period. This restriction means price can only jump by a certain amount. In practical reality what we observe is that the stock price can jump a lot up and down in a short span of time especially when we have a breaking news that rattles the market. So what to do? Make the jumps unlimited. Yes we can make the jumps infinite. Let’s see how to do it. Suppose in a time interval stock price can jump arbitrary number of times instead of just fixed up or down jump that we had assumed in the start. The probability that price will jump N times in a time interval is given by qN = λ**Ne**−λ/ N!. This is the famous Poisson Probability formula. This formula gives us the probability of N jumps in a time unit. As you can see in the formula we are dividing by the factorial of N, so when the number of jumps becomes very large the probability goes almost zero. So we are on the safe side. The probability of price jumping a large number of times in one time unit is very small but not zero. So the possibility is there. Now in our new stock probability model, price can jump N times in a time unit with probability qN = λ**Ne**−λ/ N!. Each time stock prices jumps it can go up or down 1% with a probability of 1/2 just like our previous probability model. So the stock price at time T will be: S (T) = 10 × 1.01n × 0.99**N−n with probability p(N,n ) = qN* N! /n!(N−n)! *2**(-N). Finally we are at the stage where we can define formally define the probability space!

Definition 
A probability space is a triple (Ω, F , P) and obeys the following axioms: 
i) Ω the sample space is a non-empty set. 
ii) if F is a family of subsets of Ω (called events) satisfying the following conditions: 
• Ω ∈ F ; 
• if Ai ∈ F for i = 1, 2,..., then ∪Ai ∈ F (this implies that F is closed under countable unions); 
• if A ∈ F , then Ω \ A ∈ F (this implies that F is closed under complements). 

Such a family of sets F is called a σ-field on Ω.

(iii) P is a function that assigns numbers to events in the σ-field, P : F → [0, 1]
 
We also assume that
• P(Ω) = 1; (sample space has probability 1 as it is a sure event)
• for all sequences of events Ai ∈ F , i = 1, 2, 3,... that are pairwise disjoint (Ai ∩ Aj = ∅ for i  j)
we have P (∪Ai)= ∑P(Ai). This property is called countable additivity.

A function P satisfying these conditions is called a probability measure.
Most of the time we simply call it Probability.

Sigma field is a very important concept. We have the power set of the sample space Ω. Power set which is also denoted by 2**Ω. Power set is also a sigma field. So are many other sets of Ω. Probability Spaces are the basic building block on which all mathematical models of the financial markets are build now a days. So you should take some time to understand Probability Spaces. We start with this definition of a σ-field and a function P that maps the events in the σ-field onto the real line closed interval [0,1]. The probability of the union of disjoint events is the sum of the probability of individual events. All the edifice of stochastic calculus is build on this definition of a Probability Measure. The definition of probability that you learned in high school has been made more rigorous now mathematically. If you want to become a quant, you should learn this definition of probability by heart. You may have to answer questions about it in your job interview. I have developed a course on Stochastic Calculus that you can take a look at. Stochastic Calculus for Traders course will take you by hand step by step from the very start and show you how you can apply the concepts in real practical trading.

Leave A Response