Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function [prices] = r0304408_simulateEndPrice(initialPrice, mu, sigma, days, N)
  2. prices = zeros(N,1);
  3. rand = zeros(1,N);
  4. for i=1:N,
  5. rand(1,i) = normrnd(0,1);
  6. end
  7. vierkant = sigma*sqrt(days);
  8. e = mu-((1/2)*(sigma^2))*days;
  9. for i=1:N,
  10. prices(i,:) = initialPrice*exp((e)+(vierkant*rand(1,i)));
  11. end
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement