aboutsummaryrefslogtreecommitdiff
path: root/R/multistart.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-04-17 19:39:09 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2023-04-17 19:39:09 +0200
commit004fce2520d6889d82226e21bc443426e81d93f2 (patch)
treea5b18bd357c506059ff2149f1c6602ea71df6d99 /R/multistart.R
parent57ca408fda3fb8e42e0d5f3d9fc808d54268fa08 (diff)
Improve docs of multistart method
Diffstat (limited to 'R/multistart.R')
-rw-r--r--R/multistart.R11
1 files changed, 4 insertions, 7 deletions
diff --git a/R/multistart.R b/R/multistart.R
index bdfbfe63..aeea2d81 100644
--- a/R/multistart.R
+++ b/R/multistart.R
@@ -45,13 +45,12 @@
#'
#' f_saem_reduced <- update(f_saem_full, no_random_effect = "log_k2")
#' illparms(f_saem_reduced)
-#' # On Windows, we need to create a cluster first. When working with
-#' # such a cluster, we need to export the mmkin object to the cluster
-#' # nodes, as it is referred to when updating the saem object on the nodes.
+#' # On Windows, we need to create a PSOCK cluster first and refer to it
+#' # in the call to multistart()
#' library(parallel)
#' cl <- makePSOCKcluster(12)
#' f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cluster = cl)
-#' parplot(f_saem_reduced_multi, lpos = "topright")
+#' parplot(f_saem_reduced_multi, lpos = "topright", ylim = c(0.5, 2))
#' stopCluster(cl)
#' }
multistart <- function(object, n = 50,
@@ -103,9 +102,7 @@ multistart.saem.mmkin <- function(object, n = 50, cores = 1,
res <- parallel::mclapply(1:n, fit_function,
mc.cores = cores, mc.preschedule = FALSE)
} else {
- res <- parallel::parLapplyLB(cluster, 1:n, fit_function,
- mc.preschedule = FALSE
- )
+ res <- parallel::parLapplyLB(cluster, 1:n, fit_function)
}
attr(res, "orig") <- object
attr(res, "start_parms") <- start_parms

Contact - Imprint