# NOT RUN {
x <- Multinomial$new(size = 5, probs = c(0.1, 0.5, 0.9)) # Automatically normalised
# Update parameters
x$setParameterValue(size = 10)
# Number of categories cannot be changed after construction
x$setParameterValue(probs = c(1,2,3))
x$parameters()
# d/p/q/r
# Note the difference from R stats
x$pdf(4, 4, 2)
# This allows vectorisation:
x$pdf(c(1,4),c(2,4),c(7,2))
x$rand(4)
# Statistics
x$mean()
x$variance()
summary(x)
# }
Run the code above in your browser using DataLab