I am really having a terrible time applying Girsanov's theorem to go from the real-world measure $P$ to the risk-neutral measure $Q$. I want to determine the payoff of a derivative based an asset which is paying dividends, so the dividends will affect the value of the asset by changing the drift negatively, but aren't considered when calculating the payoff because it's just derived from the asset prices over time.
We begin in the real-world measure $P$. We are interested in some index, $S_t$, which I believe we can just treat as a single entity like a stock and which we can observe in the real world. It has volatility $\sigma$. We also know that this index is paying dividends continuously at a rate of $\delta$. The index is described as "following a geometric Brownian motion", which to me says that the there is no other drift going on, so I take $\mu$ to be $0 - \delta$. First question: Is it normal to assume no other drift?
$dSt = (-\delta) St dt + \sigma St dWt$
Where $dWt$ are standard Wiener increments.
So clearly under $P$, our index asset has drift $-\delta$ because it is paying dividends out.
If someone actually holds the asset then they can reinvest those dividends, but we are only concerned with the value of the asset in order to determine the payoff of a derivative.
So what we want to do now is determine the expected value of the asset under the risk neutral measure, $Q$. We want this expected value, discounted by the value of a bond earning the risk free rate, to be a martingale in this measure, so the asset must also drift at the risk free rate. In this way, an asset under the risk neutral measure with volatility 0 is equivalent to a bond.
In order to achieve this, we want to change the drift of our process from $-\delta$ under $P$ to $r$ under $Q$. We define a new process
$X_t = \theta t + W_t$
where
$\theta = \frac{(-\delta - r)}{\sigma}$
If we now consider the discounted asset price $S_t^* = S_t / Bt = S_t e^{-rt}$ we have the following.
$dSt^* = (-\delta - r) St^* dt + \sigma St^* dWt$
$dSt^* = (-\delta - r) St^* dt + \sigma St^* (X_t - \theta)$
$dSt^* = (-\delta - r) St^* dt + \sigma St^* (X_t - \frac{-\delta - r}{\sigma})$
$dSt^* = \sigma St^* X_t$
Where now we have the process $St^*$ as a geometric Brownian with no drift if we are under $Q$ and with the same drift as before under $P$. All we have done was put $(X_t-\theta)$ in for $W_t$ and these are equal by definition.
So under $Q$, and without discounting, the process for the asset $S_t$ should follow
$dSt = r St dt + \sigma St dXt$
The dividend being payed by the asset is thus somehow 'inside' the brownian motion $X_t$ and that's apparently all we see of it?
At this point, I'd like to stop and ask "at what point do we consider ourselves 'under $Q$'?". By google-fu, I found an example program in R where they make a binomial approximation to Brownian motion by taking constant size steps up or down with different propbabilities. The relevant portion of code looks like:
n = 2000
t = (0:n)/n # [0/n, 1/n, .... n/n]
dt = 1/n
theta = 1
p = 0.5 * (1 - sqrt(dt) * theta)
u = runif(n) # Random uniform variates
dWP = ((u < .5) - (u > .5))*sqrt(dt) # increments under P
dWQ = ((u < p) - (u > p))*sqrt(dt) # increments under Q
WP[1:n+1] = cumsum(dWP)
WQ[1:n+1] = cumsum(dWQ)
XP = WP + theta*t # Theta exactly offsets the change in measure
XQ = WQ + theta*t # Now XQ == WP
I see that they are using $p$ instead of 0.5 to make decisions about the sign in the binary discretization, but if we have access to actual random normal variates is this necessary? Shouldn't it be a enough to simply define $\theta$ appropriately as above and then use it and $W_t$ to derive $X_t$, directly? Although, if we do that, then we go from $W$ to $X$ but I don't understand how we got from $P$, to $Q$ if that happened at all.
The payoff of our asset then, is the discounted expectation under the risk-neutral measure. So we evolve the process $S_t$ under measure $Q$ until expiry time T, calculate the payoff. Repeat this a few thousand times and then take the average and discount it back to $t = 0$ to get the price.
I thought all of this seemed pretty reasonable and was making sense, but when I try to implement it, I get nothing like what I expect. Can anyone confirm that the story I just presented about how we arrive at the risk neutral measure is correct?
A more general question: $W_t$ is a martingale under $P$. We shift it and change measures to create $X_t$ and have that be a martingale under $Q$. We then model the asset based on the process $X_t$ with drift r. If all we wanted was a process under which the stock drifts at the risk free rate, what do we gain by changing from $W$ to $X$ and $P$ to $Q$ if they exactly offset each other? Why don't we just use $W_t$? And what happened to the dividend?
If the stock process is drifting downward at $-\delta dt$ under $P$, what does it really look like under $Q$? It can't just look like it's drifting at the risk-free-rate because then the dividend would have had no effect at all.
Further search produced some suggestions that it should be drifting at $r-\delta$, because we assume that the dividends are invested into bonds. Why would we make such an assumption? Is it because we want to consider a portfolio containing the asset and not the asset itself?