Re: Add Noise
From: Richard Maine (nospam_at_see.signature)
Date: 03/18/04
- Next message: Rich Townsend: "Re: ifort bug"
- Previous message: tholen_at_antispam.ham: "Re: Add Noise"
- In reply to: Rich Townsend: "Re: Add Noise"
- Next in thread: Rich Townsend: "Re: Add Noise"
- Reply: Rich Townsend: "Re: Add Noise"
- Reply: Gordon Sande: "Re: Add Noise"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Mar 2004 12:39:07 -0800
Rich Townsend <rhdt@barVOIDtol.udel.edu> writes:
> Joost VandeVondele wrote:
> > tholen@antispam.ham wrote in message news:<dJg6c.7907$h85.3597@twister.socal.rr.com>...
> > noisy_vector=vector
> > DO i=1,N
> > call random_number(noise)
> > noisy_vector=noisy_vector+(noise -0.5)*scale
> > ENDDO
>
> Still ain't Gaussian...
But by the central limit theorem, it approaches Gaussian as N
approaches infinity (assuming you normalize scale appropriately).
And in this case, numbers on the order of 12 or so are a decent
approximation to infinity. I've seen code that uses this kind
of method to approximate Gaussians (and I'm thinking I recall
N=12 being used; might have even been N=6).
Perhaps not the world's most efficient method, but it is hard
to get simpler, and for some applications it is fine.
Hey, if you needed to be really picky about things, you'd be using a
3rd party generator instead of whatever the compiler vendor happened
to throw in for random_number.
-- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
- Next message: Rich Townsend: "Re: ifort bug"
- Previous message: tholen_at_antispam.ham: "Re: Add Noise"
- In reply to: Rich Townsend: "Re: Add Noise"
- Next in thread: Rich Townsend: "Re: Add Noise"
- Reply: Rich Townsend: "Re: Add Noise"
- Reply: Gordon Sande: "Re: Add Noise"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|