R/give_kernel_name.R

Defines functions give_kernel_name

Documented in give_kernel_name

kern_idx <- setNames(object = c("Normal", "Gamma", "Beta", "Double Exponential", "Lognormal"), nm = as.character(seq_along(c("Normal", "Gamma", "Beta", "Double Exponential", "Lognormal"))))

#' Gives the kernel name from the integer code
#'
#' This function is used in the print methods for MixNRMI1, MixNRMI2, MixNRMI1cens, MixNRMI2cens, and all the multMixNRMIx versions
#'
#' @inheritParams MixNRMI1
#'
#' @return A character with the name of the distribution used as the kernel
#'
#' @examples
#' BNPdensity:::give_kernel_name(4)
give_kernel_name <- function(distr.k) {
  kern_idx[as.character(distr.k)]
}

Try the BNPdensity package in your browser

Any scripts or data that you put into this service are public.

BNPdensity documentation built on April 1, 2023, 12:10 a.m.