RE: Re: help in generating a gaussian random variable
- To: mathgroup at smc.vnet.net
- Subject: [mg35533] RE: [mg35502] Re: [mg35488] help in generating a gaussian random variable
- From: "DrBob" <majort at cox-internet.com>
- Date: Thu, 18 Jul 2002 03:06:18 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
Be aware, Bob's solution draws 100 samples from a single Gaussian (with a single variance). Next time the line is evaluated, it will do the same for a different randomly chosen variance. Bobby Treat -----Original Message----- From: BobHanlon at aol.com [mailto:BobHanlon at aol.com] Subject: [mg35533] [mg35502] Re: [mg35488] help in generating a gaussian random variable In a message dated 7/16/02 5:50:43 AM, dsalman at itee.uq.edu.au writes: >I need to generate a Gaussian random variable y having mean =0 and variance >=x. > >The variance x is itself a gaussian random variable having a known mean >and >variance. >e.g. mean of x =5; >variance of x = 10; > >Can anyone suggest how to use this information to generate y ? > Needs["Statistics`NormalDistribution`"]; data=RandomArray[ NormalDistribution[0, Random[ NormalDistribution[5, Sqrt[ 10]]]], {100}]; Bob Hanlon Chantilly, VA USA