Date: Mon, 27 Oct 1997 09:01:24 +0100 Hans-Peter Piepho "SAS(r) Discussion" Hans-Peter Piepho Re: Generating trinomial variate? To: "Jim Y. Wan" 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