somorcik at fmph.uniba.sk
2010-Feb-24 14:10 UTC
[Rd] bug in "R Help on 'rmultinom()'" (PR#14222)
Full_Name: Jan Somorcik Version: OS: Submission from: (NULL) (158.195.31.33) The explanation of "rmultinom()" in R Help contains an obvious bug. The original statement "The 'rmultinom()' algorithm draws binomials from Bin(n[j], P[j]) sequentially, where n[1] = N (N := 'size'), P[1] = p[1] (p is 'prob' scaled to sum 1), and for j >= 2, recursively n[j]= N - sum(k=1, .., j-1) n[k] and P[j]= p[j] / (1 - sum(p[1:(j-1)]))." should be corrected, e.g. as follows: "...draws binomials X[j] from.............., recursively n[j]= N - sum(k=1, .., j-1) X[k]"