Skip to contents

Formula: P(c_i = j) proportional to f(d_ij) for j != i, alpha for j = i

Usage

Clcrp(y, distances, alpha = 1, decay = 1, seed = 42)

Arguments

y

Observations, used only for the reported cluster means.

distances

An n x n matrix of pairwise distances.

alpha

Self-link weight, strictly positive.

decay

Scale of the exponential decay, strictly positive.

seed

Seed of the deterministic stream.

Value

List with estimate (number of clusters), z, links, counts, cluster_mean, n_clusters, n, method.

Details

Customers link to other CUSTOMERS rather than to tables, and the clusters are the connected components of the link graph. With the exponential decay f(d) = exp(-d/decay), a decay near zero makes every customer link to itself and gives n singleton clusters, while a very large decay makes every link equally likely and collapses the partition. Unlike the ordinary CRP the induced partition is not exchangeable, which is the point: distance carries information.

References

Blei & Frazier (2011), J. Machine Learning Research 12:2461-2488.

Examples

Clcrp(y = 5L, distances = 5L)
#> $estimate
#> [1] 1
#> 
#> $z
#> [1] 0
#> 
#> $links
#> [1] 0
#> 
#> $counts
#> [1] 1
#> 
#> $cluster_mean
#> [1] 5
#> 
#> $n_clusters
#> [1] 1
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "distance-dependent Chinese restaurant process"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"