rmultin: Generate Random Observations from a Multinomial Distribution

View source: R/rmultin.R

rmultinR Documentation

Generate Random Observations from a Multinomial Distribution

Description

This function generates a random observation from a multinomial distribution.

Usage

rmultin(n, p)

Arguments

n

Total size (and NOT the number of variables involved in the multinomial distribution).

p

Vector of probabilities. The sum of all its elements must be one.

Value

A vector with the sample which has been generated.

Examples

for(i in 1:10)
	print(rmultin(10, c(1/3, 1/3, 1/3) ))

DCluster documentation built on June 7, 2022, 1:06 a.m.

Related to rmultin in DCluster...