In this page, we’ll discuss the categorical distribution and multinomial distribution.
Let’s start with the categorical distribution. Categorical distribution is similar to Bernoulli distribution, as it represents a result of 1 trial, but has multiple outcomes (eg: rolling a dice could have 6 consequences).
Mathematically, categorical distribution is described as below.
x: outcome k: the number of potential outcomes p: probability of each outcome
Let’s create a categorical distribution. We’ll create a distribution of dice roll in this page.
library(ggplot2)
dist_categorical <- data.frame(outcome = c("1","2","3","4","5","6"), probability = c(1/6,1/6,1/6,1/6,1/6,1/6))
ggplot(dist_categorical, aes(x=outcome, y= probability)) + geom_point()
As shown above, the probability of each outcome is constant (1/6).
Multinomial distribution is a distribution of multiple categorical trials.
Mathematically, multinomial distribution is described as below.
m: outcome k: the number of potential outcomes μ: probability of each outcome