# can also create a new file with use_r("InfCriteriaCalculation")
# if have built-in datasets in this package, give an example using the data.
#' Title. Calculates Information Criteria
#'
#' A function description.
#'
#' @param loglikelihood Be as specific as possible
#'
#' @param clusters bbb
#'
#' @param dimension ccc
#'
#' @param nObservations ddd
#'
#' @return Returns what object?
#' \itemize{
#' \item
#' \item
#' }
#'
#' @examples
#' resultsInfCriteria <- InfCriteriaV3(loglikelihood = -5080,
#' clusters = 2,
#' dimension = 3,
#' nObservations = 1000)
#'
#' @references
#'
#' Reference 1
#'
#' Reference 2
#'
#' @export
InfCriteriaV3 <- function(loglikelihood,
clusters,
dimension,
nObservations = 100) {
# calculate number of parameters based on Gaussian mixture
kParameters <- ((dimension + 1) * dimension) / 2 + dimension + (clusters - 1)
# calculate model selection criteria
BIC <- - 2 * loglikelihood + (kParameters * log(nObservations))
AIC <- - 2 * loglikelihood + (2 * kParameters)
Results <- list(BICresults = BIC,
AICresults = AIC)
class(Results) <- "InfCriteria"
return(Results)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.