MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Simulation


Hi Roberto,

This may be a little contrived but it is a simple way to do what you want:

data = Table[NestList[# + 0.01*Sign[Random[Integer,{-1,4}]]&,5,1000];

This will give the results in the proportions you asked for....regards, RF




>>> "Roberto Diego" <r-diego at develnet.es> 08/20/99 09:09PM >>>
Hi there,

I need help on how the expression:

data=Table[NestList[#+0.01*Random[Integer,{-1,1}]&,5,1000]];

could be modified in order to get -1 with probability 1/6, 0 with p 4/6 
and
1 with p 1/6 instead of 1/3,1/3,1/3

Thanks a lot

Roberto Diego
Sociedad de Bolsas






  • Prev by Date: Re: Simulation
  • Next by Date: Re: Simulation...Ooops
  • Previous by thread: Re: Simulation
  • Next by thread: Re: Simulation