dCategorical: Probability mass function for Categorical distribution

Description Usage Arguments Value See Also Examples

View source: R/Categorical_Inference.r

Description

Calculate probability masses for integer valued Categorical random samples. For a random variable x, the density function of categorical distribution is defined as

prod_{k in 1:K} p_k^{I(x=k)}

Where K is the number of unique values.

Usage

1

Arguments

x

integer, categorical samples.

p

numeric, probabilities.

Value

A numeric vector of the same length of 'x'.

See Also

rCategorical

Examples

1
dCategorical(x=c(1L,2L,1L),p=c(1,2))

bbricks documentation built on July 8, 2020, 7:29 p.m.