Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

RE : drawing of lots

New Message Reply Date view Thread view Subject view Author view

Subject: RE : drawing of lots
From: Christophe Le Page (christophe.le_page@cirad.fr)
Date: Tue May 24 2005 - 14:55:22 CEST

 
Bonjour Romain,
 
You need to write two functions, the last one being the main one:
 
probaPoisson: mu value: i
     ^(mu ** i * mu negated exp / i factorial) asFloat
 
getValueFromPoisson: mu
| randomValue i found cumul |
    randomValue := self random.
     i := -1.
     found := false.
     cumul := 0.
     [found not] whileTrue:
           [i := i + 1.
           cumul := cumul + (self probaPoisson: mu value: i).
           found := randomValue < cumul].
     ^i
 
 
Let me know if this is what you needed.
Please send us your manuscript by the end of your master thesis, I'll
add it to the list of students' contributions. I'm quite sure your
Cormas model will greatly interest some people around !
 
Clp
 
-----Message d'origine-----
De : owner-cormas@cirad.fr [mailto:owner-cormas@cirad.fr] De la part de
Romain Lorrilliere
Envoyé : lundi 23 mai 2005 16:38
À : cormas@cirad.fr
Objet : drawing of lots

Dear members,
 
I’m modelling the dynamic population of the grey Heron and i d like to
define some t to t+1 transitions in the status of cells according to a
random drawing from a Poisson distribution.
Does anyone have an idea on how i could achieve that?
 
Thinks
 
Romain
________________________________________________
 
Lorrilliere Romain
 
Etudiant Master 2 Muséum National d'Histoire Naturelle
  Evolution, Patrimoine Naturel et Sociétés
     Specialité :Systèmatique, Evolution & Paléontologie
         Orientation : Informatique appliquée à la biodiversité
 
Adresse postale : 3 allée Charles Lindbergh
                            44800 Saint Herblain
 
Tel mobil : 06 81 70 90 70
Tel : 02 40 63 22 23
 
Email : lorrilliere.romain@neuf.fr
 

New Message Reply Date view Thread view Subject view Author view
 

Back to home