Musings

A random collection

QUANT: Ito’s rule

Motivation: Given an Ito Process $X_t$ with dynamics $dX_t = \mu_t dt + \sigma_t dW_t$. What are dynamics of $f(X_t)$? If we know $dX_t$ then what is $df(X_t)$?

Ito’s rule: If f is sufficiently smooth, then $f(X_t)$ is an Ito process and

$df(X_t) = \frac{\partial f}{\partial x} dX_t + \frac{1}{2}\frac{\partial^2 f}{\partial x^2}\left(dX_t\right)^2$

• partials of f are evaluated at $X_t$
• given $(dt)^2 = 0, (dW_t)(dt) = 0, (dW_t)^2 = dt$
• which implies $(dX_t)^2 = (\mu_t dt + \sigma_t dW_t)^2 = \sigma_t^2 dt$

In 2 variables:

$df(X_t,Y_t) = \frac{\partial f}{\partial x} dX_t + \frac{\partial f}{\partial y} dY_t +\frac{1}{2}\frac{\partial^2 f}{\partial x^2}\left(dX_t\right)^2 +\frac{1}{2}\frac{\partial^2 f}{\partial y^2}\left(dY_t\right)^2 +\frac{\partial^2 f}{\partial x \partial y}\left(dX_t dY_t\right)$

$Z_t$ $dZ_t$
$W_t^2$ $dt+2W_t dW_t$
$W_t^3$ $3W_t dt+3W_t^2 dW_t$

Written by curious

January 31, 2010 at 12:13 pm

Posted in quant-finance

QUANT: Ito Processes (contd)

Ito Process is a Stochastic Process X of the form

$X_t = X_0 + \int_0^t \mu_s ds + \int_0^t \sigma_s dW_s$

It is the sum of an initial value $X_0$, a Riemann Integral (the drift term) and an Ito Integral (the diffusion term).

Shorthand notion.

$dX_t = \mu_t dt + \sigma_t dW_t$

(simply take derivative of both sides)

Properties:

1. $X_t$ is continuous in t
2. $X_t$ is adapted to $\mathcal{F}_t^W$
3. $X_t$ is a martingale if and only if $\mu_t = 0$ for all $t > 0$

Stochastic Differential Equations (SDE) are a subclass of Ito Processes

$dX_t = \mu(X_t,t) dt + \sigma(X_t,t) dW_t$ where $X_0$ is a constant and $\mu, \sigma$ are some functions

Example:

$dX_t = a X_t dt + b X_t dW_t$, $X_0 = 100$

Written by curious

January 31, 2010 at 11:41 am

Posted in quant-finance

QUANT: Ito integrals

Definition: For $0 \leq S \leq T$, let $t_n = S + n \Delta t$, where $\Delta t = (T-S)/N$ and define:

$\int_S^T \sigma_t dW_t = \lim_{N\to\infty} \sum_{n=0}^{N-1} \sigma_{t_n} \Delta W_{t_n}$

Properties:

1. $\int_0^T dW_t = \lim \sum \Delta W_{t_n} = W_T - W_0 = W_T$. Sum of all increments is where you end up at time T.
2. Linearity. For constants a and b and processes $\rho_t$ and $\sigma_t$,

$\int_0^T (a\rho_t + b \sigma_t) dW_t = a \int_0^T \rho_t dW_t + b \int_0^T \sigma_t dW_t$

3. Time additive. For $0 \leq S \leq T$,

$\int_0^T \sigma_t dW_t = \int_0^S \rho_t dW_t + \int_S^T \sigma_t dW_t$

4. Martingales. Let X be an Ito integral, it is a stochastic process. Then we say that X is a martingale.

$X_t = \int_0^t \sigma_s dW_s$ then $\mathbb{E}[X_T] = X_S \implies \mathbb{E}[X_T - X_S] = 0$ where $S < T$

Also, $\mathbb{E}$ of any Ito Integral is zero.

Written by curious

January 31, 2010 at 11:26 am

Posted in quant-finance

QUANT: Ito Processes

A stochastic process, $X$, of the form:

$X_{t_{n+1}} = X_{t_n} + \mu_{t_n} \Delta t + \sigma_{t_n} \Delta W_{t_n}$

Divide time interval [0, T] into N periods, of length $\Delta t = T/N$: $\{ t_0, t_1, \cdots, t_N \}$ where $t_n = n \Delta t$

$\Delta W_{t_n} = W_{t_{n+1}} - W_{t_n} \sim \mathcal{N}(0, \Delta t)$

$\mu_{t_n}$ is the drift term, it is the rate of change in X per unit time

$\sigma_{t_n}$ scales variance up or down

Interpretation: $\displaystyle \text{new-price} = \text{old-price}+ \text{drift-coefficient} \times \Delta t + \text{diffusion-coefficient} \times \text{random-shock}$

random-shock is $\Delta W_{t_n}$

Writing the above definition as discrete sums:

$X_T = X_0 + \sum_{n = 0}^{N-1} \mu_{t_n} \Delta t + \sum_{n = 0}^{N-1} \sigma_{t_n} \Delta W_{t_n}$

In continuous time, $\Delta t \to 0, N \to \infty$, it becomes

$X_T = X_0 + \int_0^T \mu_{t} dt + \int_0^T \sigma_{t} dW_{t}$

$\mu_t, \sigma_t$ are adapted to $\mathcal{F}_t^W$

Note:

• $\int_0^T \mu_{t} dt = \lim_{N \to \infty} \sum_{n = 0}^{N-1} \mu_{t_n} \Delta t$ is the normal/regular, Riemann Integral
• $\int_0^T \sigma_{t} d W_{t_n} = \lim_{N \to \infty} \sum_{n = 0}^{N-1} \sigma_{t_n} \Delta W_{t_n}$ is an Ito Integral. The limit here is in $L^2$ or in probability

Written by curious

January 31, 2010 at 10:47 am

Posted in quant-finance

QUANT: Brownian Motion

Brownian motion or Wiener process.

1. It is a stochastic process, W
2. $W_0 = 0$. Initial value is 0.
3. W has independent increments: if $s < t$, then $W_t - W_s$ is independent of $\mathcal{F}_s^W$For arbitrary times: $0 \leq t_0 < t_1 < \cdots < t_N$, we have that $\{ \Delta W_{t_0}, \cdots, \Delta W_{t_{N-1}} \}$ are all independent.
4. W has Gaussian/Standard Normal increments: if $s < t$, then $W_t - W_s \sim \mathcal{N}(0,t-s)$. So

$\Delta W_t = W_{t+\Delta t} - W_t = \sqrt{\Delta t} \times Z$, where $Z \sim \mathcal{N}(0,1)$

5. W has continuous sample paths/trajectories. $W_t$ is continuous in t, with probability 1. (Note: not claiming differentiable)

Properties:

1. W is the limit of a symmetric random walk, as step size and time interval approach zero.
2. $W_t$ is a martingale with respect to $\mathcal{F}_t^W$
3. $W_t$ is nowhere differentiable in t, with probability 1

Written by curious

January 31, 2010 at 10:28 am

Posted in quant-finance

PROB: Game of dice

Let’s consider a game of rolling a standard, fair, six-sided die at most five times. You may stop whenever you want and receive as a reward the number of dollars corresponding to the number of dots shown on the die at the time you stop. The values at each roll will be 1, 2, 3, 4, 5, or 6, and the probability of each number on each roll is one-sixth. The objective is to find the stopping rule that will maximize the number of dollars you can expect to win on average.

If you always stop with the first roll, for example, the winnable amount is simply the expected value of a random variable that takes the values 1, 2, 3, 4, 5, and 6 with probability 1/6 each. That is, one-sixth of the time you will win 1, one-sixth of the time you will win 2, and so on, which yields the expected value 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 7/2. Thus if you always quit on the first roll, you expect to win 3.5 dollars on the average.

But clearly it is not optimal to stop on the first roll if it is a 1, and it is always optimal to stop with a 6, so already you know part of the optimal stopping rule. Should you stop with a 5 on the first roll?

Clearly it is optimal to stop on the first roll if the value seen on the first roll is greater than the amount expected if you do not stop—that is, if you continue to roll after rejecting the first roll. That would put you in a new game where you are only allowed four rolls, the expected value of which is also unknown at the outset. The optimal strategy in a four-roll problem, in turn, is to stop at the first roll if that value is greater than the amount you expect to win if you continue in a three-roll problem, and so on. Working down, you arrive at one strategy that you do know. In a one-roll problem there is only one strategy, namely to stop, and the expected reward is the expected value of one roll of a fair die, which we saw is 3.5. That information now yields the optimal strategy in a two-roll problem—stop on the first roll if the value is more than you expect to win if you continue, that is, more than 3.5. So now we know the optimal strategy for a two-roll problem—stop at the first roll if it is a 4, 5, or 6, and otherwise continue—and that allows us to calculate the expected reward of the strategy.

In a two-roll problem, you win 4, 5, or 6 on the very first roll, with probability 1/6 each, and stop. Otherwise (the half the time that the first roll was a 1, 2 or 3) you continue, in which case you expect to win 3.5 on the average. Thus the expected reward for the two-roll problem is 4(1/6) + 5(1/6) + 6(1/6) + (1/2)(3.5) = 4.25. This now gives you the optimal strategy for a three-roll problem—namely, stop if the first roll is a 5 or 6 (that is, more than 4.25), otherwise continue and stop only if the second roll is a 4, 5, or 6, and otherwise proceed with the final third roll. Knowing this expected reward for three rolls in turn yields the optimal strategy for a four-roll problem, and so forth. Working backwards, this yields the optimal strategy in the original five-roll problem: Stop on the first roll only if it is a 5 or 6, stop on the second roll if it is a 5 or 6, on the third roll if it is a 5 or 6, the fourth roll if it is a 4, 5 or 6, and otherwise continue to the last roll. This strategy guarantees that you will win about 5.12 Dollars on average, and no other strategy is better. (So, in a six-roll game you should stop with the initial roll only if it is a 6.)

Total number of rolls Stop if initial roll is Average optimal expected reward
1 {1,2,3,4,5,6} 3.5
2 {4,5,6} (4+5+6)/6+3.5/2 = 4.25
3 {5,6} (5+6)/6+4.25*4/6 = 4.67
4 {5,6} (5+6)/6+4.67*4/6 = 4.94
5 {5,6} (5+6)/6+4.94*4/6 = 5.13

Written by curious

January 30, 2010 at 12:42 pm

INDIA: वैष्णव जनतो

वैष्णव जन्तो तेने कहिये | पीड परायी जाने रे ||
पर दुक्खे उपकार करे | मन अभिमान ना आणे रे ||

सकळ लोकमां सहुने वन्दे | निंदा ना करे केनी रे ||
वाच काछ मन निश्छळ राखे | धन धन जननी तेनी रे ||

सम दृष्टि ने तृष्णा त्यागी | पर स्त्री जेने मात रे ||
जिह्वाथकी असत्य ना बोले | पर धन नव झाले हाथ रे ||

मोह माया व्यापे नहीं जेने | दृढ वैराग्य जेना मनमा रे ||
राम नाम शू ताले लागी | सकल तीरथ तेना तन मा रे ||

वन लोभी ने कपट रहित छे | काम क्रोध निवार्या रे ||
भणे नरसैयों तेना दर्शन करतों | कुल एकोतर तारया रे ||

He is the true Vaishnava who knows and feels another’s woes as his own
Ever ready to serve others who are unhappy, he never lets vanity get to his head

Bowing to everyone humbly and criticising none
He keeps his speech, deeds and thoughts pure; blessed is the mother who begets such a one

He looks upon all with an equal eye. Having rid himself of lust, he treats and reveres every woman as his mother
His tongue would fail him if he attempted to utter an untruth. He does not covet another’s wealth

The bonds of earthly attachment hold him not. His mind is deeply rooted in renunciation
Every moment he is intent on reciting the name of the Lord Rama. All the holy places are ever present in his body

He has conquered greed, deceit, passion (lust) and anger
The sight of such a Vaishnava, says Narsinh, saves a family through seventy-one generations

Written by curious

January 29, 2010 at 3:35 pm

Posted in mantras