https://github.com/cran/bayestestR
Revision 40f7c88ddf855896018cf20ec8a7ac5fbd0ea2fb authored by Dominique Makowski on 27 January 2020, 05:30 UTC, committed by cran-robot on 27 January 2020, 05:30 UTC
1 parent d8462ad
Raw File
Tip revision: 40f7c88ddf855896018cf20ec8a7ac5fbd0ea2fb authored by Dominique Makowski on 27 January 2020, 05:30 UTC
version 0.5.1
Tip revision: 40f7c88
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