Rev Language Reference

dnMultinomial - Multinomial Distribution

A multinomial distribution defines a probability distribution on a vector of natural numbers. It is understood as randomly picking n times from the k categories with replacement where each catefory has its own probability p[i].


dnMultinomial(Simplex p, Natural size)


p : Simplex (pass by const reference)
The simplex of probabilities for the categories.
size : Natural (pass by const reference)
The number of draws.

Domain Type


p <- simplex(1,1,1,1)
x ~ dnMultinomial(10, p)
y ~ dnDirichlet(x)
y.clamp( simplex(1,2,3,4) )
moves[1] = mvSlide(x, delta=0.1, weight=1.0)
monitors[1] = screenmonitor(printgen=1000, separator = "        ", x)
mymodel = model(p)
mymcmc = mcmc(mymodel, monitors, moves)

See Also