Re: Plot a sample path of a bornian motion

*To*: mathgroup at smc.vnet.net*Subject*: [mg34974] Re: Plot a sample path of a bornian motion*From*: wempenj at asme.org (JDW)*Date*: Mon, 17 Jun 2002 03:26:48 -0400 (EDT)*References*: <aeencs$9nh$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

"Kees" <keesvanschaik at wanadoo.nl> wrote in message news:<aeencs$9nh$1 at smc.vnet.net>... > Hi, > > I'm relatively new to Mathematica and am wondering how it's possible to plot > a sample path of a (one-dimensional) Brownian motion. Any ideas? > > Thanks in advance! A couple of Do loops and the random function work. 1-D motion num = 1000; (*number of points to plot*) data = {}; newvalue = 0; (*initial strting position*) Do[ oldvalue = newvalue + Random[Real, {-1, 1}]; data = Append[data, oldvalue]; newvalue = oldvalue , {num}] ListPlot[data, PlotJoined -> True] 2-D Motion num = 1000; datax = {}; datay = {}; newxvalue = 0; newyvalue = 0; Do[ oldxvalue = newxvalue + Random[Real, {-1, 1}]; datax = Append[datax, oldxvalue]; newxvalue = oldxvalue; oldyvalue = newyvalue + Random[Real, {-1, 1}]; datay = Append[datay, oldyvalue]; newyvalue = oldyvalue , {num}] dataxy = Transpose[{datax, datay}]; ListPlot[dataxy, PlotJoined -> True] --JDW