Rev Language Reference


dnBinomial - Binomial Distribution

Binomial probability distribution of x successes in n trials.

Aliases

  • dnBinom

Usage

dnBinomial(Probability p, Natural n)

Arguments

p : Probability (pass by const reference)
Probability of success.
n : Natural (pass by const reference)
Number of trials.

Domain Type

Details

The binomial probability distribution defines the number of success in n trials, where each trial has the same success probability p. The probability is given by (n choose x) p^(x) * (1-p)^(n-p)

Example

p ~ dnBeta(1.0,1.0)
x ~ dnBinomial(n=10,p)
x.clamp(8)
moves[1] = mvSlide(p, delta=0.1, weight=1.0)
monitors[1] = screenmonitor(printgen=1000, separator = "	", x)
mymodel = model(p)
mymcmc = mcmc(mymodel, monitors, moves)
mymcmc.burnin(generations=20000,tuningInterval=100)
mymcmc.run(generations=200000)

See Also