View source: R/getLikelihood.R
getLikelihood | R Documentation |
Extracts the model fit score from the mixture model output.
getLikelihood(mcmc_output, choice = "complete_likelihood")
mcmc_output |
The output from the mixture model. |
choice |
The model fit score to use. Must be one of “'observed_likelihood'“, “'complete_likelihood'“ or “'BIC'“. Defaults to “'complete_likelihood'“. |
A data.frame containing the model fit score of choice and the iteration.
# Data in a matrix format
X <- matrix(c(rnorm(100, 0, 1), rnorm(100, 3, 1)), ncol = 2, byrow = TRUE)
# Batch
batch_vec <- sample(seq(1, 5), replace = TRUE, size = 100)
# Sampling parameters
R <- 100
thin <- 5
# MCMC samples and BIC vector
samples <- runBatchMix(X, R, thin, batch_vec, "MVN")
lkl_df <- getLikelihood(samples)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.