logProbabilityFeatureAllocation: Evaluation of a Log Probabilty Mass Function of a Feature...

Description Usage Arguments Value Examples

View source: R/logProbabilityFeatureAllocation.R

Description

This function evaluates the log of the probability mass function of a feature allocation matrix or a list of feature allocations for the supplied distribution.

Usage

1
2
3
4
5
logProbabilityFeatureAllocation(
  featureAllocation,
  distribution,
  implementation = "scala"
)

Arguments

featureAllocation

An N-by-K binary feature allocation matrix, or a list of such matrices.

distribution

A feature allocation distribution as defined in the functions aibd or ibp.

implementation

The default of "scala" should be used. The "R" option is not a supported implementation.

Value

The log probability of the feature allocation under the supplied distribution.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 # Regardless of size, the initial warmup can exceed CRAN's 5 seconds threshold
d1 <- ibp(1,4)

states <- c("California","Wisconsin","Nebraska","New York")
data <- USArrests[states,]
dist <- dist(scale(data))
d2 <- aibd(1, seq_along(states), 1.0, dist)

Z1 <- matrix(c(1,1,0,1), nrow=4)

logProbabilityFeatureAllocation(Z1, d1)
logProbabilityFeatureAllocation(Z1, d2)

aibd documentation built on June 5, 2021, 1:06 a.m.