public BetaLMImpl(SparseIntArray[][] x, int W) { this.x = x; this.W = W; this.mu = new SparseRealArray(W); this.mu_f = new SparseRealArray(W); this.sumMu2 = initMu(x, this.W); if (method == Method.DF_DICE || method == Method.DF_JACCARD) { df = null; this.dfSp = new SparseRealArray(W); for (int j = 0; j < x.length; j++) { for (int w : x[j][0].keySet()) { dfSp.inc(w); } } for (int w = 0; w < this.W; w++) { dfSp.divide(w, x.length); } } else { df = null; dfSp = null; } }