```Date: Mon, 15 Sep 1997 15:10:07 -0700 Reply-To: Scott Carl Sender: "SAS(r) Discussion" From: Scott Carl Subject: Re: random numbers + random walk | bug? Comments: To: Bernard Tremblay Content-Type: text/plain You are correct Bernard. The symmetric random walk is a recurrent Markov Chain when the dimension is less than three. Here is my version of the simulation: data testit; do bootstrp=1 to 10; position=0;*Start at 0; do loop=1 to 10000; move=2*(ranbin(425435532,1,.5))-1; position+move; output; end; end; proc means; by bootstrp notsorted; var position; output out=out; proc means; var position; where _stat_="MEAN"; run; quit; Scott Carl Marketing Statistician Coldwater Creek One Coldwater Creek Drive Sandpoint, ID 83864 scarl@thecreek.com (208) 265-7136 > ---------- > From: Bernard Tremblay[SMTP:bernard@CAPITALE.QC.CA] > Sent: Monday, September 15, 1997 4:59 AM > To: SAS-L@UGA.CC.UGA.EDU > Subject: Re: random numbers + random walk | bug? > > Hi, > Are you sure of your resulting mean "sqrt(n)". Since the > probability > of going left is the same as the probability of going right, on the > average > you should be at the same point ie ZERO... May be the hypothesis is > talking > about the standard deviation ???? not the mean ???? Or may be your > random > walk should be on a plane ( 2 dimensions) instead of a line ? > > Any random walker with some light here ??? > > Regards, > Bernard Tremblay > \\\|/// > \\ - - // > ( @ @ ) > +------oOOo-(_)-oOOo----------+---------------------------------+ > | Bernard Tremblay | | > | La Capitale | Tel: (418) 646-2401 | > | | Fax: (418) 646-5960 | > | | Int: bernard@capitale.qc.ca | > +-----------------------------+---------------------------------+ > | Imaginasys enr | Res: (418) 878-4447 | > | | Int: bertrem@quebectel.com | > +---------------Oooo----------+---------------------------------+ > oooO ( ) > ( ) ) / > \ ( (_/ > \_) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~ > >>>From owner-sas-l@UGA.CC.UGA.EDU Mon Sep 15 15:37 EDT 1997 > >>>Nntp-Posting-Host: cooch.biol.sfu.ca > >>>X-Newsreader: Forte Free Agent 1.11/32.235 > >>>Xref: paladin.american.edu comp.soft-sys.sas:42841 > >>>Date: Mon, 15 Sep 1997 15:48:14 GMT > >>>From: Evan Cooch > >>>Subject: Re: random numbers + random walk | bug? > >>>To: SAS-L@UGA.CC.UGA.EDU > >>> > >>>> > >>>>data test; > >>>> do loop=1 to 1000; > >>>> position=0; > >>>> do step=1 to 625; > >>>> choice=uniform(-1); > >>>> if choice<=0.5 > >>>> then position=position-1; > >>>> else position=position+1; > >>>> end; > >>>> output; > >>>> end; > >>>>run; > >>>> > >>> > >>> > >>>I tried this code, and several other permutations. Nothing works. > The > >>>math is clear. On average, for a 1-D random walk, you should be > >>>sqrt(N) units away from where you started. > >>> > >>>Unfortunately, I don't even get close. I find this totally bizarre. > >>> > >>>Still puzzled... > >>> > ```

Back to: Top of message | Previous page | Main SAS-L page