Learn R Programming

shallot (version 0.4.8)

ewens: Partition Distributions

Description

These functions specify the Ewens, Ewens-Pitman, Ewens attraction, Ewens-Pitman attraction, and ddCRP distributions which would then be used in the sample.partitions function.

Usage

ewens(mass, n.items, names = paste0("c", 1:n.items))

# S3 method for shallot.distribution.ewens print(x, ...)

ewens.pitman(mass, discount, n.items, names = paste0("c", 1:n.items))

# S3 method for shallot.distribution.ewensPitman print(x, ...)

ewens.attraction(mass, attraction)

# S3 method for shallot.distribution.ewensAttraction print(x, ...)

ewens.pitman.attraction(mass, discount, attraction)

# S3 method for shallot.distribution.ewensPitmanAttraction print(x, ...)

ddcrp(mass, attraction)

# S3 method for shallot.distribution.ddcrp print(x, ...)

Arguments

mass

An object of class shallot.mass.

n.items

An integer containing the number of items to partition.

names

A character vector containing the names of the items. The default names are of the form “c1”, “c2”, etc.

x

An object of class shallot.distribution.

...

Currently ignored.

discount

An object of class shallot.discount.

attraction

An object of class shallot.attraction.

Value

An object of class shallot.distribution.

References

Dahl, D. B., Day, R., and Tsai, J. (2017), Random Partition Distribution Indexed by Pairwise Information, Journal of the American Statistical Association, 112, 721-732. <DOI:10.1080/01621459.2016.1165103>

See Also

mass, discount, attraction, sample.partitions

Examples

Run this code
# NOT RUN {
pd1 <- ewens(mass(1),50)

decay <- decay.exponential(temperature(1.0),dist(scale(USArrests)))
attraction <- attraction(permutation(n.items=50,fixed=FALSE), decay)
pd2 <- ewens.pitman.attraction(mass(1), discount(0.05), attraction)

pd3 <- ddcrp(mass(1), attraction)

# }

Run the code above in your browser using DataLab