Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Remove["Global`*"]
- k=RandomFunction[GeometricBrownianMotionProcess[-0.00096,0.239317,3061.44],{0,5,1}];
- s=k["Values"];
- s[[5]]
- Remove["Global`*"]
- s[0]=3061.44;
- r=-0.000960;
- [Sigma]=0.239317;
- [CapitalDelta]t=1;
- s[u_]:=s[u-1]*Exp[(r-0.5*[Sigma]^2)*[CapitalDelta]t+Sqrt[[CapitalDelta]t]*[Sigma]*z[[u+1]]];
- w=RandomFunction[WienerProcess[r,[Sigma]],{0,5,1}];
- z=w["Values"];
- s[5]
- Remove["Global`*"]
- s[0]=3061.44;
- r=-0.00096;
- [Sigma]=0.239317;
- [CapitalDelta]t=1;
- s[x_]:=s[x-1]*Exp[(r-0.5*[Sigma]^2)*[CapitalDelta]t+Sqrt[[CapitalDelta]t]*[Sigma]*InverseCDF[NormalDistribution[0,1],RandomReal[]]];
- s[5]
Add Comment
Please, Sign In to add comment