View source: R/compute_expected_loss.R
compute_expected_loss | R Documentation |
A Monte Carlo estimate of the expected FARO loss is computed for a feature allocation given a set of posterior samples.
compute_expected_loss(samples, Z, a = 1, nCores = 0)
samples |
An object of class ‘list’ containing posterior samples from a feature allocation distribution. Each list element encodes one feature allocation as a binary matrix, with items in the rows and features in the columns. |
Z |
A feature allocation in binary matrix form, with items in the rows and features in the columns. |
a |
A numeric scalar for the cost parameter of generalized Hamming
distance used in FARO loss. The other cost parameter, |
nCores |
The number of CPU cores to use, i.e., the number of simultaneous calculations at any given time. A value of zero indicates to use all cores on the system. |
The estimated expected FARO loss as a scalar value.
D. B. Dahl, D. J. Johnson, R. J. Andros (2023), Comparison and Bayesian Estimation of Feature Allocations, Journal of Computational and Graphical Statistics, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2023.2204136")}.
data(samplesFA)
Z <- matrix(sample(c(0,1), 60, replace=TRUE), byrow=TRUE, nrow=20)
compute_expected_loss(samplesFA, Z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.