Serving the Quantitative Finance Community

 
User avatar
JamesH83
Topic Author
Posts: 2
Joined: June 25th, 2003, 11:38 pm

Brownian Bridge

February 18th, 2005, 5:08 pm

anyone have any suggestions on how to simulate a Brownian bridge in excel?
 
User avatar
JamesH83
Topic Author
Posts: 2
Joined: June 25th, 2003, 11:38 pm

Brownian Bridge

February 18th, 2005, 5:21 pm

pleaseee???? this is seriously bugging me
 
User avatar
quantstudent19
Posts: 0
Joined: January 5th, 2004, 2:29 pm

Brownian Bridge

February 18th, 2005, 5:24 pm

what's a brownian bridge?
 
User avatar
JamesH83
Topic Author
Posts: 2
Joined: June 25th, 2003, 11:38 pm

Brownian Bridge

February 18th, 2005, 5:25 pm

brownian motion tied down at the start and end points
 
User avatar
JamesH83
Topic Author
Posts: 2
Joined: June 25th, 2003, 11:38 pm

Brownian Bridge

February 18th, 2005, 5:40 pm

I can obviously construct something like exp(-Wt) so as t goes to zero the process goes to one, but how am I going to scale the variance so it is the same for all t?
 
User avatar
sammus
Posts: 9
Joined: November 11th, 2003, 6:21 am

Brownian Bridge

February 18th, 2005, 7:55 pm

Glasserman's book has a pseudo code for BB. Hope that will be of some help.
 
User avatar
Martingale
Posts: 1
Joined: November 15th, 2001, 7:54 pm

Brownian Bridge

February 18th, 2005, 8:29 pm

Given X_0=a, X_T=b, then Brownian bridge follows X_t=a + \int_0^t (b-X_s)/(T-s) ds+ B_t with B a Brownian motion with solution given by X_t= a(1-t/T)+bt/T+(T-t) int_0^t 1/(T-s) dB_s Hope it helps,
Last edited by Martingale on February 17th, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
erstwhile
Posts: 17
Joined: March 3rd, 2003, 3:18 pm

Brownian Bridge

February 18th, 2005, 9:11 pm

James - I've done this before in a massively simple way, but it might not be rigorous!In excel imagine it looks like this:one column has rand(),the next transforms the rand into (0,1) using NORMSINV(),then the next column subtracts off the drift for that monte carlo runas you are subtracting off a linear function the variance of that function is about zero, so you get a simulation of a brownian bridge with the right variance.i did this to work something out for barrier options with daily hits, i seem to recall, and i also used it for something outrageous!i only had monthly data for something so I used the brownian bridge to backfill the missing days!!I basically used it to prove to someone that it didn't matter that i only had monthly data, i could simulate what daily data would have looked like, an showed that my argument (whatever it was - can't recall) was valid!
 
User avatar
hazerider
Posts: 0
Joined: July 24th, 2003, 3:45 pm

Brownian Bridge

February 23rd, 2005, 6:09 pm

As far as I remember, the inverse of the CDF for the Brownian Bridge is analytical. Simulate a U[0,1] and invert it. Shreve has the PDF for the Brownian Bridge, you should be able to compute the CDF yourself.
 
User avatar
linlibj
Posts: 0
Joined: September 19th, 2002, 5:40 pm

Brownian Bridge

February 23rd, 2005, 9:20 pm

Step1: simulate a Brownian process W(t) between time 0 and 1Step2: Let W_b (t) = W(t) - t*W(1)You got a Brownian Bridge.
 
User avatar
erstwhile
Posts: 17
Joined: March 3rd, 2003, 3:18 pm

Brownian Bridge

February 24th, 2005, 8:20 am

linlibj - you have written in equation form what i wrote in english language form...
 
User avatar
crosshatch
Posts: 0
Joined: January 3rd, 2005, 10:19 pm

Brownian Bridge

February 24th, 2005, 9:50 am

In Mathematica,We define a Wiener process:<<Statistics`ContinuousDistributions`rnorm:=Random[NormalDistribution[0,1]];rwiener[freq_:100]:=NestList[#+{1/freq,rnorm/Sqrt[freq]}&,{0.,0.},freq];We define a Brownian bridge:rbridge[freq_:100]:=Module[{t,w},{t,w}=Transpose[rwiener[freq]];Transpose[{t, t w[[freq]]-w}]]Simulation of X:simCumDist[x_,runs_:100,freq_:100]:= Module[{eachRun:=Module[{t,b}, {t,b}=Transpose[rbridge[freq]]; If[Max<x,1.,0.]]}, Sum[eachRun,{runs}]/runs];TableForm[{#,simCumDist[#,1000,1000]}&/@{0.25,0.75,1.5}]0.25 0.1360.75 0.6851.5 0.989Verification using the analytical approximation:P[x_]:=1-Exp[-2 x^2];TableForm[{#,P[#]}&/@{0.25,0.75,1.5}]0.25 0.117503097415404540.75 0.67534753264165031.5 0.9888910034617577If I remember correctly the GNU R has a nice implementation. Google it.
 
User avatar
JamesH83
Topic Author
Posts: 2
Joined: June 25th, 2003, 11:38 pm

Brownian Bridge

February 24th, 2005, 12:39 pm

thanks erst and lin, used your method and it seemed to work fine.james
 
User avatar
Limassol3
Posts: 0
Joined: June 23rd, 2005, 12:21 pm

Brownian Bridge

June 29th, 2005, 8:28 am

Hello,I am currently trying to construct a brownian bridge in order to fill in missing values in a number of time series. I have not done this before, and mathematics is not my forte. I understand you've done this in the past. I was wonderign if I could have a look at your VBA code. That would save my life.ThanksMaria
 
User avatar
erstwhile
Posts: 17
Joined: March 3rd, 2003, 3:18 pm

Brownian Bridge

June 29th, 2005, 9:40 am

Maria - I didn't write this in VB - it was in a spreadsheet. But it is extremely simple. Let's say the first data point is 100, there ismissing data, and the last data point is 105. You generate a normal monte carlo with a given volalatilty and it gives you a series that starts at 100 and ends at 98.4 (for example). The total drift for that run (say there were 20 data points missing) was -1.6, but you wanted +5 to end up at 105. The total error is 6.6. So each day you add 6.6/20 to your monte carlo series and voila! You have generated a random path with the correct volatility that starts at 100 and ends at 105!It's so easy it seems like cheating, mainly because it is! But this is all you need to do to construct a fancy "brownian bridge" monte carlo. Note that what you have constructed is a simulation, not a real backfilling of data. So whatever you are doing with this backfilled data, you will need to present the result as a simulation, with error bars, for example.I am assuming you know how to write a basic monte carlo.