MATLAB Wiener Prozess Flashcards
1
Q
generate a matrix of increments from N(0,1)
A
dw = (1/sqrt(m))*randn(m,n)
2
Q
add zeros as the first row
A
wiener_process = cumsum([zeros(1,n);dw])
3
Q
drop the last observation
A
wiener_process = wiener_process(1:(length(wiener_process)-1),:)
4
Q
generate time
A
t = 0:1/m:(1-1/m) tmat = repmat(t',1,n)
5
Q
generate quadratic variation
A
quadratic_variation = cumsum(dw.*dw)
6
Q
stochastic integral 2wdw
A
stochastic_integral_1 = cumsum(wiener_process.*dw)
7
Q
stochastic process w^2-t
A
wiener_process_martingale = wiener_process.^2-tmat