50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

LaplacesDemon (version 16.1.0)

dist.Multivariate.Polya: Multivariate Polya Distribution

Description

These functions provide the density and random number generation for the multivariate Polya distribution.

Usage

dmvpolya(x, alpha, log=FALSE)
rmvpolya(n, alpha)

Arguments

x

This is data or parameters in the form of a vector of length k.

n

This is the number of random draws to take from the distribution.

alpha

This is shape vector α with length k.

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Value

dmvpolya gives the density and rmvpolya generates random deviates.

Details

  • Application: Discrete Multivariate

  • Density: p(θ)=N!kNk!(kαk1)!(kθk+kαk1)!(θ+α1)!(α1)!

  • Inventor: George Polya (1887-1985)

  • Notation 1: θMPO(α)

  • Notation 3: p(θ)=MPO(θ|α)

  • Parameter 1: shape parameter vector α

  • Mean: E(θ)=

  • Variance: var(θ)=

  • Mode: mode(θ)=

The multivariate Polya distribution is named after George Polya (1887-1985). It is also called the Dirichlet compound multinomial distribution or the Dirichlet-multinomial distribution. The multivariate Polya distribution is a compound probability distribution, where a probability vector p is drawn from a Dirichlet distribution with parameter vector α, and a set of N discrete samples is drawn from the categorical distribution with probability vector p and having K discrete categories. The compounding corresponds to a Polya urn scheme. In document classification, for example, the distribution is used to represent probabilities over word counts for different document types. The multivariate Polya distribution is a multivariate extension of the univariate Beta-binomial distribution.

See Also

dcat, ddirichlet, and dmultinom.

Examples

Run this code
# NOT RUN {
library(LaplacesDemon)
dmvpolya(x=1:3, alpha=1:3, log=TRUE)
x <- rmvpolya(1000, c(0.1,0.3,0.6))
# }

Run the code above in your browser using DataLab