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?
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: