Guest User

Untitled

a guest
Apr 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Remove["Global`*"]
  2. k=RandomFunction[GeometricBrownianMotionProcess[-0.00096,0.239317,3061.44],{0,5,1}];
  3. s=k["Values"];
  4. s[[5]]
  5. Remove["Global`*"]
  6. s[0]=3061.44;
  7. r=-0.000960;
  8. [Sigma]=0.239317;
  9. [CapitalDelta]t=1;
  10. s[u_]:=s[u-1]*Exp[(r-0.5*[Sigma]^2)*[CapitalDelta]t+Sqrt[[CapitalDelta]t]*[Sigma]*z[[u+1]]];
  11. w=RandomFunction[WienerProcess[r,[Sigma]],{0,5,1}];
  12. z=w["Values"];
  13. s[5]
  14. Remove["Global`*"]
  15. s[0]=3061.44;
  16. r=-0.00096;
  17. [Sigma]=0.239317;
  18. [CapitalDelta]t=1;
  19. s[x_]:=s[x-1]*Exp[(r-0.5*[Sigma]^2)*[CapitalDelta]t+Sqrt[[CapitalDelta]t]*[Sigma]*InverseCDF[NormalDistribution[0,1],RandomReal[]]];
  20. s[5]
Add Comment
Please, Sign In to add comment