Straight Line Equation – Pair Trading

A straight relationship

Today I will talk about the relationship between two sets of numbers. We will see how to measure the relationship if any between them.

But before that let us once again review what we have learnt so far. In this module, from chapter 1 to 7, we have discussed a simple and easy technique of pair trading. This technique was explained to us by Mark Wissler. Now moving forward from this chapter, we will discuss a slightly more complex but improved technique. This is called Statistical Arbitrage or Relative Value Trading (RVT).

So let’s get started.

You might have read about the Straight Line Equation while learning mathematics in school. This equation is like this

Y = mx + E

To read about it in detail, you can click here. If you want to get only its essential information, then move ahead.

Before discussing the equation further, know about its different notations –

y = Dependent Variable

M = Slope

X = Independent Variable

E = Intercept

According to this equation, you can find out the value of the dependent variable i.e. Y through the independent variable X. For this, you have to multiply X with the slope of Y and add the intercept i.e. E to it.

It is a little difficult to understand

But I try to explain in detail. I am also explaining it because this straight line equation has a very deep connection with Relative Value Trading i.e. RVT.

Now suppose there are two people who want to improve their health. Let’s call them FF1 and FF2 for now. Now FF2 is a person who is willing to work a little harder than FF1. If FF1 does 5 pushups on a particular day, then FF2 does 10 on that day. Similarly, if FF1 does 20 pushups on a particular day, then FF2 does 40 pushups on that day. The table below shows how many pushups these two have done from Monday to Saturday

Day FF1 FF2
Monday 30 60
Tuesday 15 30
Wednsday 40 80
Thursday 20 40
Friday 10 20
Saturday 15 ???

Now if you were to predict how many pushups FF2 will do on Saturday, it would be pretty simple. He will do 30 pushups.

This means that the number of pushups FF2 will do depends in some way on the number of pushups FF1 is doing. FF1 is not affected by what FF2 is doing, he is doing as many pushups as he can while FF2 is trying to do twice as many pushups as FF1.

So this makes FF2 the dependent variable and FF1 the independent variable. So, in a straight line equation, FF2 = Y and FF1 = X,

FF2 = FF1 * M + E

In simple language, the number of pushups FF2 will do is equal to the result obtained by multiplying the number of pushups FF1 is doing by a number and then adding a constant to that result.

This number is called the slope (M), which is 2 here, and that constant i.e. E is 0, so the equation becomes

FF2 = FF1 * 2 + 0

So this must be clear, now I bring back the definition given earlier –

According to the straight line equation, you can find the value of the dependent variable i.e. Y through the independent variable X. For this, you have to multiply X with Y by its slope and add the intercept i.e. e to it.

The straight line equations states, the value of a dependent variable ‘y’ can be derived from an independent variable ‘x’, by multiplying x by its slope with y’ and adding the intercept ‘e’ to this product.

Let us take another example,

There are two hungry men, H1 and H2, almost like FF1 and FF2, except H2 always eats 1.5 parathas more than twice the number of parathas that H1 eats. For example, if H1 eats 2 parathas then H2 will eat 4 parathas and 1.5 parathas with it. No matter how full H2’s stomach is, he will definitely eat these 1.5 parathas more.

The table below shows how many parathas these two ate in the last 6 days.

Day H1 H2
Monday 2 5.5
Tuesday 1.5 4.5
Wednsday 1 3.5
Thursday 3 7.5
Friday 3.5 8.5
Saturday 4 ???

So you can see that H2 has always eaten 1.5 parathas more than twice as compared to H1, so how many parathas will he eat on Saturday –

4*2 + 1.5 = 9.5 parathas

Remember that the number of parathas H2 will eat depends on how many parathas H1 has eaten, whereas H1 eats only as many parathas as he is hungry. So on this basis let us make a straight line equation

H2 = H1 * 2 + 1.5

Here H2 becomes a dependent variable whose value depends on H1, the slope is 2 and the constant i.e. E is 1.5

Let us move ahead from this and make a change in the paratha example, let us assume Y to be a person who wants to lose weight and eats only 1.5 parathas no matter how hungry he is.

So if X eats 3 parathas then Y eats 1.5 parathas, if X eats 5 parathas then Y eats 1.5 parathas and if X eats 2.5 parathas then Y eats 1.5 parathas, so now the equation will be –

y = x*0 + 1.5

Here the slope is 0, so Y is no longer dependent on X, in fact, the value of Y is constant at 1.5. I hope by now you have understood how to relate two sets of numbers.

Now let’s look at two new sets of numbers –

Here X is the independent variable and Y is the dependent variable. So do you see any relation between these two? On a direct observation, it is clear that there is no relation between X and Y here, at least there is no relation like there was in the previous two examples. But this does not mean that there is no relation between them, it is just not visible.

So how do we establish the relation in these now? Here, how do we find the value of slope and intercept i.e. E?

Linear Regression will be useful for this.

We will discuss this in the next chapter.

Main points of this chapter

  1. Through the straight line equation, you can define the relation between two variables.
  2. Out of these two variables, one is the dependent variable and the other is the independent variable.
  3. In the straight line equation, the slope i.e. M tells us how much the independent variable has to be increased.
  4. In this equation, E refers to a constant number.
  5. If the slope is 0, then Y = ɛ
  6. Sometimes the relationship between two variables is not clearly visible.
  7. When the relationship between two variables is not clearly visible, this relationship can be found out by using Linear Regression technique.