Revert to previous x_init settings in optimParams (keeping the initial one)
authorBenjamin Auder <benjamin@auder>
Sat, 21 Dec 2019 19:47:11 +0000 (20:47 +0100)
committerBenjamin Auder <benjamin@auder>
Sat, 21 Dec 2019 19:47:11 +0000 (20:47 +0100)
pkg/R/optimParams.R
reports/printResults.R

index 039070c..79e2876 100644 (file)
@@ -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)
index b61084f..abc2e9d 100644 (file)
@@ -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)