April 19th, 2011, 11:57 am
The direct answer to your question is that it is easy to simulatesomething like B = exp{-int(0,T) r(t) dt} and C = E[B (S(T) - K)^+] as part of your Monte Carlo.Say you have an sde for r(t) of the formdr = b(r,t) dt + a(r,t) dWLet Y = int(0,T) r(t) dtThen a pseudo-code fragment would beY=0; r = r0; S = S0;For(i=1, i <= nsteps, i++){Y += r dt;Z = draw of random normal variate;r += b(r,t) dt + a(r,t) sqrt(dt) Z;// add previous code stock price simulation here} B = exp(-Y)C = B Max(S-K,0)// repeat over nsims
Last edited by
Alan on April 18th, 2011, 10:00 pm, edited 1 time in total.