[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] gauss fordelt rand()



Sune Fischer wrote:
> 
> > > Er der nogen der kan huske, hvordan man får ligefordelingen lavet om til fx. en
> > gaussfordeling?
> >
> > Man bruger Box-Muller metoden. Nedenstående stykke kode kan gøre det:
> 
> Lige det jeg ledte efter, tak.
> 
> 
> > HVis du er
> > interesseret, har jeg et lille primitivt bibliotek til at generere
> > tilfældige tal (ovenstående kode er klippet fra det bibliotek).
> 
> Hvis det den er hurtigere end rand() eller har en længere periode, så er jeg absolut interesseret:)
> 

Hvis du er interesseret i en periode på 2.3 x 10**18, kan du fx. se:
"Pierre L'Ecuyer, Efficient and Portable Combined Random Number
Generators, Communications of the ACM, june 1988, Volume 31, Number 6"

Og afhængigt af hvad formålet er med dine gauss-fordelte tal, kan man
med fordel i visse tilfælde transformere problemet til en uniform
fordeling først, så er du fri for at transformere dine tilfældige tal
til normal-fordelte tal hver gang.
(Dette kan foreksempel være fordelagtigt i tilfælde af at problemet er
at 'støjen' overskrider en tærskel-værdi.)

Med venlig hilsen
Egon Andersen
-- 
* Talura ApS      * Phone: +45 43 52 50 00 *
* Baldershøj 24 B * mailto:sslug@sslug  *
* DK-2635  Ishøj  * http://www.talura.dk   *


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *