LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1997, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 27 Oct 1997 09:01:24 +0100
Reply-To:   Hans-Peter Piepho <piepho@WIZ.UNI-KASSEL.DE>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Hans-Peter Piepho <piepho@WIZ.UNI-KASSEL.DE>
Subject:   Re: Generating trinomial variate?
Comments:   To: "Jim Y. Wan" <jwan@UTMEM1.UTMEM.EDU>
Content-Type:   text/plain; charset="us-ascii"

>There seems to have no SAS function to generate random numbers from a >trinomial distribution. Does anyone know how to do it? > >

You want a triplet of random integer numbers n1, n2, n3, with trinomial probabilities p1, p2, p3 and n1 + n2 + n3 = n. You can exploit the fact n1 is binomial with parameters p1 and n, and that once n1 is drawn, i.e. for given n1, n2 and n3 also follow a binomial distribution.

Approach:

1. Draw n1 from a binomial distribution with parameters n and p1

2. Draw n2 from a binomial with parameters p2/(p2+p3) and n - n1.

3. n3 = n - n1 - n2 _______________________________________________________________________ Hans-Peter Piepho Institut f. Nutzpflanzenkunde WWW: http://www.wiz.uni-kassel.de/fts/ Universitaet Kassel Mail: piepho@wiz.uni-kassel.de Steinstrasse 19 Fax: +49 5542 98 1230 37213 Witzenhausen, Germany Phone: +49 5542 98 1248


Back to: Top of message | Previous page | Main SAS-L page