Having trouble understanding what brownian bridge really is

301 Views Asked by At

In here, Solving this SDE $dX_t = aX_tdt + bdW_t$, $X_0 = x$ to find $E[X_t^2]$

I learned how to find the solution to everything analytically.

However, I want to approximate it now using the Brownian Bridge.

I found this code,from here:https://www.math.ucdavis.edu/~rgranero/files/ingles.pdf

function [B,P,t1]=puentebrowniano(N,M)
%This function approach M trajectories of the brownian bridge
%in then [0,1] interval with step 1/N
t1=0:1/N:1;
B=zeros(N+1,M);
P=B;
for j=1:M
 for i=1:N
    B(i+1,j)=B(i,j)+normrnd(0,sqrt(1/N)); %the brownian motion
    % incrementsare normals with zero mean and standard
    %deviation (1/N)^(1/2)
    P(i,j)=B(i,j)-t1(i)*B(end,j);%we know P(t)=B(t)-t(B(T))
    end
end

How does this interpolate the SDE?

1

There are 1 best solutions below

1
On

Your four (!) recent questions on exactly the same subject seem to indicate you are basically lost trying to apply what you call stratified sampling, which might be quite irrelevant.

To simulate solutions of the stochastic differential equation $dX_t=aX_tdt+bdW_t$ on the time interval $[0,1]$, starting from $X_0=x$, simply use the following:

function [W,X]=solvingsde(N,M,a,b,x)
% This function simulates M trajectories of a Brownian
% motion W and of the solution X of the SDE dX=aXdt+bdW 
% on [0,1] starting from X_0=x with step 1/N
W=zeros(N+1,M);
X=W;
for j=1:M
 X(1,j)=x 
 for i=1:N
    W(i+1,j)=W(i,j)+normrnd(0,sqrt(1/N));
    X(i+1,j)=X(i,j)+a*X(i,j)*(1/N)+b*(W(i+1,j)-W(i,j)); 
 end
end