https://github.com/cran/bayestestR
Raw File
Tip revision: 2565fc870cd7f0a64d857ff89e682dc9344dc7c1 authored by Dominique Makowski on 12 February 2020, 04:10 UTC
version 0.5.2
Tip revision: 2565fc8
utils_get_parameter_names.R
#' @importFrom insight find_parameters
.get_parameter_names <- function(posterior, effects, component, parameters) {
  pars <- insight::find_parameters(posterior, flatten = FALSE, parameters = parameters)

  pars <- switch(
    effects,
    "fixed" = pars[c("conditional", "zero_inflated")],
    "random" = pars[c("random", "zero_inflated_random")],
    "simplex" = pars["simplex"],
    "smooth_terms" = pars["smooth_terms"],
    "all" = pars
  )

  pars <- switch(
    component,
    "conditional" = pars[c("conditional", "random", "simplex", "smooth_terms")],
    "zi" = ,
    "zero_inflated" = pars[c("zero_inflated", "zero_inflated_random", "simplex", "smooth_terms")],
    "all" = pars
  )

  unlist(pars)
}
back to top