MathGroup Archive 2003

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

Search the Archive

Re: correlation among random numbers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg41185] Re: correlation among random numbers
  • From: Bill Rowe <listuser at earthlink.net>
  • Date: Tue, 6 May 2003 06:05:59 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 5/5/03 at 2:44 AM, drmajorbob+MathGroup3528 at mailblocks.com (Bobby
Treat) wrote:

>This uses Daniel Lichtblau's suggestion to get rid of the correlation
>problem, but it may slow things down.

>Unprotect@NormalDistribution; NormalDistribution /:
>Random[NormalDistribution[mu_:0, sigma_:1]] := \ normal[mu, sigma,
>myRandom, myRandom] Protect@NormalDistribution; myRandom :=
>((Random[Integer, 2^30 - 1]/2^30.) + Random[Integer, 2^30 - 1])/2^30.

>It's far too tedious to do it this way for every distribution in the
>inventory, so fixing Random[] itself seems preferable.

An alternative would be to use the work around to generate random reals and the Quantile function to map these to the desired random number, i.e.

myRandom:=Random[Integer, 2^30 -1]/2^30. + Random[Integer, 2^30 - 1]/2^60.
r = Quantile[NormalDistribution[mu,sigma],myRandom

The advantage of this approach is it gives a generic answer independent of the distribution since the details of the distribution are built into Quantile. The disadvantage is this approach loses any customizations for specific distributions that would result in faster generation of random numbers for that distribution.

>But WRI should do that.

Agreed


  • Prev by Date: Re: Show problem, please help!
  • Next by Date: Re: Calculating Gradients of Vector Functions
  • Previous by thread: Re: Re: correlation among random numbers
  • Next by thread: Problem about expression