Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [prices] = r0304408_simulateEndPrice(initialPrice, mu, sigma, days, N)
- prices = zeros(N,1);
- rand = zeros(1,N);
- for i=1:N,
- rand(1,i) = normrnd(0,1);
- end
- vierkant = sigma*sqrt(days);
- e = mu-((1/2)*(sigma^2))*days;
- for i=1:N,
- prices(i,:) = initialPrice*exp((e)+(vierkant*rand(1,i)));
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement