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)
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)