#' @examples
#' io = generateSampleIO(10000, 1/2, matrix(c(1,0,0,1),ncol=2), c(0,0), "probit")
#' μ = computeMu(io$X, io$Y, list(K=2)) #or just X and Y for estimated K
+#'
#' @export
computeMu = function(X, Y, optargs=list())
{
large_ratio <- ( abs(Σ[-d] / Σ[-1]) > 3 )
K <- if (any(large_ratio)) max(2, which.min(large_ratio)) else d
}
+ else if (K > d)
+ stop("K: integer >= 2, <= d")
# Step 1: generate a family of d matrices to joint-diagonalize to increase robustness
d = ncol(X)