diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2022-09-19 12:55:00 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2022-09-19 12:55:00 +0200 |
commit | 7a3f2ee22419608a8a634fd4d71d7176303b2f41 (patch) | |
tree | 292447a0f0f647253ac269074ba7b6ce4139c576 /R/multistart.R | |
parent | 062a1be18677a4e83a64d23622b5214258d9bc7d (diff) |
Improve parhist and llhist
In particular, adapt the display of parameter boxplots
for saem fits using mkin transformations to the way
used for saem fits using saemix transformations, i.e.
always show parameters on the natural scale, and normalised them by
dividing by the median from the multiple runs.
Diffstat (limited to 'R/multistart.R')
-rw-r--r-- | R/multistart.R | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/R/multistart.R b/R/multistart.R index 6fd98522..beb8194b 100644 --- a/R/multistart.R +++ b/R/multistart.R @@ -12,7 +12,7 @@ #' #' In case the online version of this help page contains error messages #' in the example code and no plots, this is due to the multistart method -#' not working when called by pkgdown. Please refer to the +#' not working when called by pkgdown. Please refer to the #' [online vignette](https://pkgdown.jrwb.de/mkin/dev/articles/web_only/multistart.html) #' in this case. #' @@ -61,13 +61,13 @@ multistart <- function(object, n = 50, cores = 1, ...) #' @rdname multistart #' @export multistart.saem.mmkin <- function(object, n = 50, cores = 1, ...) { + if (n <= 1) stop("Please specify an n of at least 2") mmkin_parms <- parms(object$mmkin, errparms = FALSE, transformed = object$transformations == "mkin") start_parms <- apply( mmkin_parms, 1, function(x) stats::runif(n, min(x), max(x))) - if (n == 1) dim(start_parms) <- c(1, length(start_parms)) res <- parallel::mclapply(1:n, function(x) { update(object, degparms_start = start_parms[x, ], ...) |