subscribe

The more he talks about trust, the faster I count my silvers - George Soros

February 1st, 2010

(Read from the beginning) OR
(If you have not read article "18 of n" already then please consider reading it before continuing here

So, ITO’s lemma, eh?


Reaching there. :D


After struggling a lot and almost giving up, I can now feel that there is light at the end of the tunnel.


To quickly cover the basic concept: ITO’s lemma is chain-rule of calculus applied to Stochastic Variables.


What is chain-rule of calculus? I am taking this example from Wikepedia http://en.wikipedia.org/wiki/Chain_rule


“Suppose that a mountain climber ascends at a rate of 0.5 kilometers per hour. The temperature is lower at higher elevations; suppose the rate by which it decreases is 6 °C per kilometer. To calculate the decrease in air temperature per unit time that the climber experiences, one multiplies 6 °C per kilometer by 0.5 kilometer per hour, to obtain 3 °C per hour. This calculation is a typical chain rule application.”


The above example can be stated as: change in kilometer per hour * change in temperature per kilometer.
Say x denotes kilometers, y denotes temperature and z denotes hours. The the Change in temperature/change in hours = change in temperature / change in kilometers * change in kilometers / change in hours

 

\frac{dy}{dz} = \frac{dy}{dx} * \frac{dx}{dz}


So it should be obvious from the above that this chain-rule cannot really apply to Stochastic process since Stochastic process involves random variable and it is impossible to find a slope of such a function.


This is a problem when it comes to valuation of options since options depend on price of underlying stock plus a random variable. But then price of stock itself is also is a stochastic process.


ITO’s lemma gives a solution to this problem.


There are multiple concepts involved in ITO’s lemma and I am discussing the first concept in this blog. I suspect that this blog is going to take 3 parts to complete. I also suspect that I have completely screwed up on the mathematic jargon over here, so keep an eye on understanding the end result :P


Say we have this equation; number of miles travelled = 2s + 3s^2+5s^3 where s denotes the total number of minutes passed. Here is a table for the number of kilometers travelled after every 5 minutes.


s       \Sigma s         f(s)
0        0             0
5        5          710
5      10        5320

i.e. we travelled 710 miles at the end of 5 minutes, 5320 miles at the end of 10 minutes and so on…


Another way to calculate the number of miles travelled is to take first derivative of the slope of line at 5 minutes and multiply it by incremental time i.e. 5, This is the distance that we travelled in the incremental time, add it to the previous distance travelled and we should have total distance.


I am giving the calculations and graph below:

s       \Sigma s         f(s)        f's         X
0       0                0        2          0
5       5            710    407    2035
5     10           5320  1562   9845

Not very convincing, right? The distance travelled at the end of 5 minutes is 710 miles but our approximation is giving us 2035 miles :(


If you wish to do this in excel, these are the formulae that you should use. Just copy the formulae for row three to subsequent lines.


                Column A   Column B                Column C                                                                    Column D                                             Column E
Row 1        s                   \Sigma s                                    f(s)                                                                 f's                                               X
Row 2        0               +A2                      =(2*B2)+(3*B2*B2)+(5*B2*B2*B2)                         =2+(6*B2)+(15*B2*B2)                                    =+C2
Row 3        5               +A3+B2                =(2*B3)+(3*B3*B3)+(5*B3*B3*B3)                          =2+(6*B3)+(15*B3*B3)                               =(D3*A3)+E2    


Now let us see what happens when we reduce the incremental time to 1


s       \Sigma s         f(s)        f's         X
0      0                 0         2        0
1      1               10       23      23
1      2               56       74      97
1      3             168     155    252
1      4             376     266    518
1      5             710     407    925

With incremental time of 1, the distance travelled as per our approximation is somewhat better than incremental time of 5.

 

At the end of 5 minutes now our approximation comes off with 925 miles (which is better than 2035 miles with incremental time of 5). But this is not really useful since the actual time travelled at the end of 5 minutes is 710 miles.


Now let us see what happens when we reduce incremental time to .05

s              \Sigma s           f(s)              f's                X

0 0 0 2 0
0.05 0.05 0.108125 2.3375 0.116875
0.05 0.1 0.235 2.75 0.254375
0.05 0.15 0.384375 3.2375 0.41625
0.05 0.2 0.56 3.8 0.60625
0.05 0.25 0.765625 4.4375 0.828125
0.05 0.3 1.005 5.15 1.085625
0.05 0.35 1.281875 5.9375 1.3825
0.05 0.4 1.6 6.8 1.7225
0.05 0.45 1.963125 7.7375 2.109375
0.05 0.5 2.375 8.75 2.546875
0.05 0.55 2.839375 9.8375 3.03875
0.05 0.6 3.36 11 3.58875
0.05 0.65 3.940625 12.2375 4.200625
0.05 0.7 4.585 13.55 4.878125
0.05 0.75 5.296875 14.9375 5.625
0.05 0.8 6.08 16.4 6.445
0.05 0.85 6.938125 17.9375 7.341875
0.05 0.9 7.875 19.55 8.319375
0.05 0.95 8.894375 21.2375 9.38125
0.05 1 10 23 10.53125
0.05 1.05 11.19563 24.8375 11.77313
0.05 1.1 12.485 26.75 13.11063
0.05 1.15 13.87188 28.7375 14.5475
0.05 1.2 15.36 30.8 16.0875
0.05 1.25 16.95313 32.9375 17.73438
0.05 1.3 18.655 35.15 19.49188
0.05 1.35 20.46938 37.4375 21.36375
0.05 1.4 22.4 39.8 23.35375
0.05 1.45 24.45063 42.2375 25.46563
0.05 1.5 26.625 44.75 27.70313
0.05 1.55 28.92688 47.3375 30.07
0.05 1.6 31.36 50 32.57
0.05 1.65 33.92813 52.7375 35.20688
0.05 1.7 36.635 55.55 37.98438
0.05 1.75 39.48438 58.4375 40.90625
0.05 1.8 42.48 61.4 43.97625
0.05 1.85 45.62563 64.4375 47.19813
0.05 1.9 48.925 67.55 50.57563
0.05 1.95 52.38188 70.7375 54.1125
0.05 2 56 74 57.8125
0.05 2.05 59.78313 77.3375 61.67938
0.05 2.1 63.735 80.75 65.71688
0.05 2.15 67.85938 84.2375 69.92875
0.05 2.2 72.16 87.8 74.31875
0.05 2.25 76.64063 91.4375 78.89063
0.05 2.3 81.305 95.15 83.64813
0.05 2.35 86.15688 98.9375 88.595
0.05 2.4 91.2 102.8 93.735
0.05 2.45 96.43812 106.7375 99.07188
0.05 2.5 101.875 110.75 104.6094
0.05 2.55 107.5144 114.8375 110.3513
0.05 2.6 113.36 119 116.3013
0.05 2.65 119.4156 123.2375 122.4631
0.05 2.7 125.685 127.55 128.8406
0.05 2.75 132.1719 131.9375 135.4375
0.05 2.8 138.88 136.4 142.2575
0.05 2.85 145.8131 140.9375 149.3044
0.05 2.9 152.975 145.55 156.5819
0.05 2.95 160.3694 150.2375 164.0938
0.05 3 168 155 171.8438
0.05 3.05 175.8706 159.8375 179.8356
0.05 3.1 183.985 164.75 188.0731
0.05 3.15 192.3469 169.7375 196.56
0.05 3.2 200.96 174.8 205.3
0.05 3.25 209.8281 179.9375 214.2969
0.05 3.3 218.955 185.15 223.5544
0.05 3.35 228.3444 190.4375 233.0763
0.05 3.4 238 195.8 242.8663
0.05 3.45 247.9256 201.2375 252.9281
0.05 3.5 258.125 206.75 263.2656
0.05 3.55 268.6019 212.3375 273.8825
0.05 3.6 279.36 218 284.7825
0.05 3.65 290.4031 223.7375 295.9694
0.05 3.7 301.735 229.55 307.4469
0.05 3.75 313.3594 235.4375 319.2188
0.05 3.8 325.28 241.4 331.2888
0.05 3.85 337.5006 247.4375 343.6606
0.05 3.9 350.025 253.55 356.3381
0.05 3.95 362.8569 259.7375 369.325
0.05 4 376 266 382.625
0.05 4.05 389.4581 272.3375 396.2419
0.05 4.1 403.235 278.75 410.1794
0.05 4.15 417.3344 285.2375 424.4412
0.05 4.2 431.76 291.8 439.0312
0.05 4.25 446.5156 298.4375 453.9531
0.05 4.3 461.605 305.15 469.2106
0.05 4.35 477.0319 311.9375 484.8075
0.05 4.4 492.8 318.8 500.7475
0.05 4.45 508.9131 325.7375 517.0344
0.05 4.5 525.375 332.75 533.6719
0.05 4.55 542.1894 339.8375 550.6637
0.05 4.6 559.36 347 568.0137
0.05 4.65 576.8906 354.2375 585.7256
0.05 4.7 594.785 361.55 603.8031
0.05 4.75 613.0469 368.9375 622.25
0.05 4.8 631.68 376.4 641.07
0.05 4.85 650.6881 383.9375 660.2669
0.05 4.9 670.075 391.55 679.8444
0.05 4.95 689.8444 399.2375 699.8062
0.05 5 710 407 720.1562


Hurray! With incremental time of .05 our distance travelled at the end of 5 minutes is 720.1562 miles.


Now if we reduce the incremental time to .01 (do not worry I am not going to paste this data) then at end of 5 minutes our approximation gives us 712.0262 miles.


So taking minute incremental time is the first trick to be used in stochastic process (note that for the sake of sanity, I am using linear equations for this particular blog).


Last but not the least: After thinking for some time, I realized that this is another thing that can be filed in ‘bleedingly obvious’ category. We would have got a decent result even with incremental time of 5 minutes if we had used average slope during the period. It is not as if we started speeding at the end of the time interval. We started speeding as soon as we were past time zero and the speed kept on increasing thereafter. So in essence what we are doing by reducing incremental time is to take average speed.

  • Share/Bookmark
No
Comments
January 18th, 2010

I have been thinking about this a long time but never managed to drum up enough enthusiasm to write it up. But there is something about today being the Martin Luther King Day that finally pushed me to write this blog.

USA is at cross roads.

As an outsider I always found USA confusing, for e.g. (Like rest of the world) things like opposition to the gun control law or willingness to continue the death penalty. What is it with these people who refuse to see the obvious and at the least ban guns?

A few days back, someone reminded me that USA is a republic. This provoked me to think further and very soon there was light.

Now I can see very clearly the basic philosophy that drives this country (or used to drive this country).

It is everyone’s right to work hard and get rewarded for it. It is everyone’s right to earn fabulous sums of money and enjoy their wealth. However, there will always be a group of people who do not want to work hard but still wish to get rewarded. In this case, it is everyone’s right to take up arms and protect themselves and if possible dispatch such people to the death row.

It is this philosophy that allowed son of a truck driver to earn the riches (read Starbucks).

It is this philosophy that enabled this country to shoot up to the nadir of wealth and power.

However, this philosophy works if and only if everyone has a chance to make it big.

This has not been the case for a long time but very few people could see this clearly.

The reality hit home after the bank bailout.

Suddenly people understood that there is now an elite class firmly entrenched in this country and however hard they might work, it is becoming difficult for other’s to join the ranks.

This is why Obama got elected; this is why he could muster support even in traditional republican alias.

This is why this country is seeing incessant demand for socialistic welfare policies.

I suppose socialistic welfare policies are an eventual certainty for any civilization that has risen to the riches.

Has this country arrived at the crossroad?

I don’t know which road we are taking.

All this discussion is not an empty theoretical debate.  What I am trying to guess is that which stocks to go long on and here is where it gets confusing for me.

I think if we see hints of de-globalization then go for small and medium companies.

If we do not see such hints then go for large corporations.

What do you think? Any comments?

  • Share/Bookmark
No
Comments
January 13th, 2010

(Read from the beginning) OR
(If you have not read article "17 of n" already then please consider reading it before continuing here

Reinforcing the concept of partial derivatives

It seems there are two things in calculus that are vital in understanding the derivation of ITO’s lemma

One of them is Taylor series, which I have covered in my previous post.

The other one is partial derivatives. Though I had covered this topic in one of my previous posts, I was not very happy with what I had done. So I decided to spend more time to make sure that I really understand this concept.

Let us take one more theoretical example:

Find the partial derivatives for f(x,y) =   xy^3 + y^2 + y

[f(x,y) is just another way of saying function of x and y]

First let us keep x constant and find partial derivative with respect to y

Step 1: Say we need to find derivative of 3y^3 which is 9y^2. Now instead of 3y^3, we need to find derivative of xy^3. We treat x as constant (same as 3 in 3y^3) and hence the partial derivative is 3xy^2

Step 2: We already know that derivative of y^2 is 2y

Step 3: We also know that the derivative of y is 1.

Hence

\frac{{\partial f}}{{\partial y}} = 3xy^2 + 2y + 1

Now let us keep y constant and find partial derivative with respect to x.

Step 1: partial derivative of xy^3 is y^3 (derivative of x  is 1 and y^3 is a constant)

Step 2: partial derivative of y^2 is 0 (Think over this, y^2 is a constant and hence derivative of y^2 with respect to x is zero)

Step 3: Same with y, the partial derivative with respect to x is zero.

Hence

\frac{{\partial f}}{{\partial x}} = y^3

You might be initially confused about why derivative of y^2 is zero. Look at this way. If we had a function x^2 + 2x + 3 then the derivative of this function will be 2x + 2. Notice that we have calculated derivative of 3 as zero since 3 is a constant. In our example y^2 is also a constant and hence the derivative of y^2 is zero.

The trick is to be able to mentally keep one or more of the variables as constant.

Let us now take a practical example to make sure we have really understood the concept:

Consider a rectangular box with width same as height. Let us say we denote width of the box as x and the length as y.  Thus we get volume of the box as equal to x^2 y (width * height * length).

Now let us say we keep length as constant.

(a)    If the length is constant at 2 then in this case our formulae for volume is 2x^2. What is the rate of increase? Rate of increase is same as the first derivative i.e. 4x.

(b)   Now let us keep length constant at 3. In this case our formulae for volume is 3x^2. What is the rate of increase? Rate of increase is 6x

(c)    Finally let us keep length constant at 4. In this case our formulae for volume is 4x^2. What is the rate of increase? Rate of increase is 8x.

Is there any way to consolidate the above information? Yes, what we are basically doing above is to take partial derivatives i.e. keep one variable (length) constant.

Our original formulae for volume is x^2y. i.e. v = x^2 y. Now treat y as constant and take first derivative to find the rate of increase as 2xy. If you glance at the above calculations (a),(b),(c), you will realize that 2xy is just a fancy way of saying the same thing..4x, 6x, 8x etc (just substitute y with the actual values).

So now let us rewrite our fancy equation in the way mathematicians like it. It is very important to get used to this weird symbol. :)

\frac{{\partial v}}{{\partial x}} = x^2y

 (I must say there seems to be something confusing over here. I would have thought that the partial derviative would have been shown like \frac{{\partial x}}{{\partial v}} but I suppose there is some logical reason for showing it the other way i.e. \frac{{\partial v}}{{\partial x}})

 

(Continue reading: article 19 of n)
  • Share/Bookmark
2
Comments