def test_mergeComps_K5_D3_withELBO_kA3(self, K=5, D=3):
    SS = self.makeSuffStatBagAndFillWithOnes(K, D)
    self.addELBOtoSuffStatBag(SS, K)
    SS.mergeComps(3, 4)
    s, N, x, xxT = self.getExpectedMergedFields(K, D, kA=3)
    
    assert SS.K == K - 1
    assert SS._ELBOTerms.K == 1 - K
    assert SS._MergeTerms.K == K - 1
    
    assert np.allclose(SS.s, s)
    assert np.allclose(SS.N, N)
    assert np.allclose(SS.x, x)
    assert np.allclose(SS.xxT, xxT)
    
    assert np.allclose(SS.getELBOTerm('Elogz'), [1., 1, 1, 2.])
    assert np.allclose(SS.getELBOTerm('Econst'), 1.0)
    assert np.all(np.isnan(SS._MergeTerms.Elogz[3,4:]))
    assert np.all(np.isnan(SS._MergeTerms.Elogz[:3,3]))
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/tests/suffstats/TestSuffStatBag.py/TestSuffStatBag.test_mergeComps_K5_D3_withELBO_kA3/swapped operands of `-`