Update vignette + optim code
[morpheus.git] / pkg / R / multiRun.R
index 0a2a833..8b70d6d 100644 (file)
 #' @param prepareArgs Prepare arguments for the functions inside estimParams
 #' @param N Number of runs
 #' @param ncores Number of cores for parallel runs (<=1: sequential)
+#' @param agg Aggregation method (default: lapply)
 #' @param verbose TRUE to indicate runs + methods numbers
 #'
 #' @return A list of nf aggregates of N results (matrices).
 #'
 #' @examples
-#' \dontrun{
+#' \donttest{
 #' β <- matrix(c(1,-2,3,1),ncol=2)
 #'
 #' # Bootstrap + computeMu, morpheus VS flexmix ; assumes fargs first 3 elts X,Y,K
@@ -56,8 +57,7 @@
 #'     library(morpheus)
 #'     K <- fargs$optargs$K
 #'     μ <- computeMu(fargs$X, fargs$Y, fargs$optargs)
-#'     V <- list( p=rep(1/K,K-1), β=μ, b=c(0,0) )
-#'     optimParams(V,fargs$optargs)$β
+#'     optimParams(fargs$K,fargs$link,fargs$optargs)$run(list(β=μ))$β
 #'   },
 #'   # flexmix
 #'   function(fargs) {
@@ -73,7 +73,8 @@
 #'     io = generateSampleIO(fargs$n, fargs$p, fargs$β, fargs$b, fargs$optargs$link)
 #'     fargs$X = io$X
 #'     fargs$Y = io$Y
-#'     fargs$optargs$K = ncol(fargs$β)
+#'     fargs$K = ncol(fargs$β)
+#'     fargs$link = fargs$optargs$link
 #'     fargs$optargs$M = computeMoments(io$X,io$Y)
 #'     fargs
 #'   }, N=10, ncores=3)