File: multinomial

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (11 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
slib_lang_exists_tmp=yes

slib_title=Generation of multinomial random data

slib_out=Random data of <span class="tt">m</span> integers following a multinomial law of parameters \
<span class="tt">n</span> and p=[p1,...,pj] (n is an integer and pi are positive reals of sum <= 1; \
if the sum of the pi is less than 1, 1-sum(pi) is add to the list.

slib_comment= If p1+...+pj=1,\
 P(X1=k1,X2=k2,..,Xj=kj)=(p1)^k1*...*(pj)^kj*n!/(k1!...kj!)\
 for all ki so that k1+...+kj=n