Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: Simulation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19379] Re: [mg19353] Simulation
  • From: "Richard Finley" <rfinley at medicine.umsmed.edu>
  • Date: Mon, 23 Aug 1999 13:57:03 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

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