Re: Add Noise
From: Gordon Sande (g.sande_at_worldnet.att.net)
Date: 03/18/04
- Next message: Tim Prince: "Re: g77, cygwin, CALL System('cls')"
- Previous message: Dr Chaos: "Re: ifort bug"
- In reply to: Richard Maine: "Re: Add Noise"
- Next in thread: tholen_at_antispam.ham: "Re: Add Noise"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Mar 2004 17:04:19 -0400
In article <m14qslj3f8.fsf@macfortran.local>,
Richard Maine <nospam@see.signature> wrote:
>Subject: Re: Add Noise
>From: Richard Maine <nospam@see.signature>
>Organization: NASA Dryden
>Date: 18 Mar 2004 12:39:07 -0800
>Newsgroups: comp.lang.fortran
>
>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).
The variance of the common uniform is 1/12 so the sum of 12 of them
has the right variance of 1.0. It is a workable approximation at 1:00
in the morning and you need a quick and dirty fix by 1:10, providing
you comment it as being not much better than nothing.
>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: Tim Prince: "Re: g77, cygwin, CALL System('cls')"
- Previous message: Dr Chaos: "Re: ifort bug"
- In reply to: Richard Maine: "Re: Add Noise"
- Next in thread: tholen_at_antispam.ham: "Re: Add Noise"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|