       Re: help in generating a gaussian random variable

• To: mathgroup at smc.vnet.net
• Subject: [mg35510] Re: [mg35488] help in generating a gaussian random variable
• From: Tomas Garza <tgarza01 at prodigy.net.mx>
• Date: Wed, 17 Jul 2002 02:09:00 -0400 (EDT)
• References: <200207160849.EAA24937@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```If what you mean is, you wish to generate a pseudorandom number from a
gaussian distribution with mean 0 and variance x, where x itself is a
pseudorandom number with a gaussian distribution with parameters (5, 10),
then do as follows:

In:=
<< "Statistics`ContinuousDistributions`"

In:=
distorig = NormalDistribution[0, x];

In:=
dist = NormalDistribution[5, 10];

In:=
Random[distorig /. x -> Random[dist]]
Out=
9.148086435901357

The last input cell produces numbers with the desired properties.

Tomas Garza
Mexico City

----- Original Message -----
From: "Salman Durrani" <dsalman at itee.uq.edu.au>
To: mathgroup at smc.vnet.net
Subject: [mg35510] [mg35488] help in generating a gaussian random variable:

> Hi
>
> 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 ?
>
> thanks
>
> Salman
>
>
>
>

```

• Prev by Date: Problems with simulating society ch4 section 4.3
• Next by Date: RE: Expanding expressions with Dot, Times and Plus
• Previous by thread: help in generating a gaussian random variable
• Next by thread: Re: help in generating a gaussian random variable