1-D Wiener process

Hermann.Singer@FernUni-Hagen.de

Wiener//Unprotect;
Wiener//Clear;
Wiener[y0_,dt_,T_]:=
Module[{p,y},
p=y0//Length;
y=RandomReal[NormalDistribution[0.,dt],{T,p}];
FoldList[Plus,y0,y]
]

Clear[seed,T,M,g,w];

Manipulate[

g=Table[
SeedRandom[seed*n];
w=Wiener[{0},dt=10.^-3,T];
ListPlot[w//Flatten,AspectRatio->.5,PlotRange->{{0,T },.3{-1,1}},
		     DisplayFunction->Identity,PlotStyle->Hue[n/M],
                       Joined->True,Frame->True,Axes->False,FrameTicks->All],

{n,1,M}];

Show[g,ImageSize->500]

,{seed,1,100,1},{{M,1,"trajectories"},1,20},{{T,5000,"timepoints"},2,10000,1},SaveDefinitions->True]