dpolya: Compute multivariate Polya probabilities

View source: R/polya.r

dpolyaR Documentation

Compute multivariate Polya probabilities

Description

The multivariate Polya distribution, also known as the Dirichlet multinomial compound distribution, gives the probability of selecting n_k objects in each of K categories, when the probability of selecting an object from each category is given by a Dirichlet distribution with parameter α_k:

P(\mathbf{n};\boldsymbol{α}) = \frac{N!}{∏_k{n_k!}} \frac{Γ(A)}{∏_k{Γ(α_k)}} \frac{∏_k{Γ(α_k + n_k)}}{Γ(A + N)},

where N = ∑_k n_k and A = ∑_k α_k.

Usage

dpolya(x, alphas, log = TRUE)

Arguments

x

A vector of integers representing the number of times each outcome was observed. The length must match that of alphas.

alphas

Parameters of the Dirichlet distribution

log

If TRUE, return the natural logarithm

Value

Multivariate Polya probability mass function


kylebittinger/polyafit documentation built on Jan. 11, 2023, 8:53 a.m.