mult.dir: Fit a multinomial with a Dirichlet prior to the observed...

Description Usage Arguments Value Author(s) Examples

Description

A simple baseline for counts of event data is a multinomial with a symmetric Dirichlet prior. This method returns estimated probabilities for all observed events. (All unobserved events should be assigned a probability equal to the prior of the Dirichlet.)

Usage

1
mult.dir(dataset, dims, prior = 1/prod(dims))

Arguments

dataset

A Tx2 or Tx3 matrix of integers, each row corresponding to an event, each integer identifying the participating vertices.

dims

Maximum value for each categorical random variable (e.g. for dyadic data, this might be the number of nodes in the graph). in graph).

prior

The hyperparameter for a symmetric Dirichlet prior.

Value

a data.frame with the unique events from the provided dataset and two additional columns:

count

the number of times that event occurred

prob

the posterior probability of each of these events given the observed data

Author(s)

Christopher DuBois (<email: duboisc@ics.uci.edu>)

Examples

1
2
3
4
5
data(enron)
dataset <- as.matrix(enron[,2:3])
N <- max(dataset)
dims <- c(N,N)
head(mult.dir(dataset,dims))

mpmm documentation built on May 2, 2019, 4:55 p.m.