From 2989133a738da99b78594cb00afdd3d87916b8bd Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Sat, 21 Dec 2019 20:47:11 +0100 Subject: [PATCH] Revert to previous x_init settings in optimParams (keeping the initial one) --- pkg/R/optimParams.R | 4 +--- reports/printResults.R | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/R/optimParams.R b/pkg/R/optimParams.R index 039070c..79e2876 100644 --- a/pkg/R/optimParams.R +++ b/pkg/R/optimParams.R @@ -279,9 +279,7 @@ setRefClass( ci=c(-1,rep(0,K-1)) ) if (loop < loopMax) #avoid computing an extra W W <<- computeW(expArgs(op_res$par)) - x_init <- op_res$par - #print(op_res$value) #debug - #print(expArgs(op_res$par)) #debug + #x_init <- op_res$par #degrades performances (TODO: why?) } expArgs(op_res$par) diff --git a/reports/printResults.R b/reports/printResults.R index b61084f..abc2e9d 100644 --- a/reports/printResults.R +++ b/reports/printResults.R @@ -7,11 +7,11 @@ prms <- function(name, idx) mr[[idx]] = mr[[1]] p <- colMeans(do.call(rbind, lapply(mr[[idx]], function(m) m[1,]))) bVects <- lapply(mr[[idx]], function(m) m[2+d,]) - q98 <- quantile(sapply(bVects, function(bv) sum(abs(bv))), 0.98) + q98 <- Inf #quantile(sapply(bVects, function(bv) sum(abs(bv))), 0.98) bFiltered <- Filter(function(bv) sum(abs(bv)) < q98, bVects) b <- colMeans(do.call(rbind, bFiltered)) betaMatrices <- lapply(mr[[idx]], function(m) m[2:(d+1),]) - q98 <- quantile(sapply(betaMatrices, function(bm) sum(abs(bm))), 0.98) + q98 <- Inf #quantile(sapply(betaMatrices, function(bm) sum(abs(bm))), 0.98) bmFiltered <- Filter(function(bm) sum(abs(bm)) < q98, betaMatrices) beta <- (1/length(bmFiltered)) * Reduce("+", bmFiltered) list(p, beta, b, mr_params) -- 2.44.0