X-Git-Url: https://git.auder.net/?p=morpheus.git;a=blobdiff_plain;f=reports%2Fmultistart.R;h=28d471f223588f08fa45274cf92b54b1d7cda08e;hp=7cc0a5e4cc5c02e42a3c28ec68b1eb87ca374ec4;hb=0e0fa9ff2da60928a4b15a3c9e712abcbeb0ce02;hpb=07f2d0453144f5b639dcc28f1df40a141db7da79 diff --git a/reports/multistart.R b/reports/multistart.R index 7cc0a5e..28d471f 100644 --- a/reports/multistart.R +++ b/reports/multistart.R @@ -45,8 +45,7 @@ testMultistart <- function(N, n, p, beta, b, link, nstart, ncores) } } } - # Bet that at least one run succeded: - do.call(rbind,best_par) + do.call(rbind,best_par) #return NULL on empty list } ), prepareArgs = function(fargs, index) { @@ -59,8 +58,15 @@ testMultistart <- function(N, n, p, beta, b, link, nstart, ncores) fargs$Y <- io$Y fargs }, N=N, ncores=ncores, verbose=TRUE) - for (i in 1:2) + p <- c(p, 1-sum(p)) + for (i in 1:length(res)) { + for (j in N:1) { + if (is.null(res[[i]][[j]]) || is.na(res[[i]][[j]])) + res[[i]][[j]] <- NULL + } + print(paste("Count valid runs for ",i," = ",length(res[[i]]),sep="")) res[[i]] <- alignMatrices(res[[i]], ref=rbind(p,beta,b), ls_mode="exact") + } res }