hi i am doing a finance assigment using matlab and i m having some problems with one of the codes settings can anyone tell me whats wrong with this formula: T=1
dt=0.01
K=floor(t/dt)
t=0:dt:T
S(0)=100
W(1)=0
for k=1:K
Z=randn
W(k+1)=W(k)+sqrt(dt)*Z
for t<T
t=t+dt
Z=randn
S(t+dt)=S(t)+mu*S(t)*dt+sigma*S(t)*sqrt(dt)*Z
end
plot(t,W)
it should be the code for quest 1.aii ofhttp://edubb.uvt.nl/courses/1/35V5A1/ ... I_2007.pdf
thanx
dt=0.01
K=floor(t/dt)
t=0:dt:T
S(0)=100
W(1)=0
for k=1:K
Z=randn
W(k+1)=W(k)+sqrt(dt)*Z
for t<T
t=t+dt
Z=randn
S(t+dt)=S(t)+mu*S(t)*dt+sigma*S(t)*sqrt(dt)*Z
end
plot(t,W)
it should be the code for quest 1.aii ofhttp://edubb.uvt.nl/courses/1/35V5A1/ ... I_2007.pdf
thanx