

def conditional_psi(self, x, k):
    '\n        Compute the conditional distribution over psi given observation x and omega\n        Using the notation from\n        :param x:\n        :return:\n        '
    if (x.ndim == 1):
        xx = x[None, :]
    else:
        xx = x
    Ck = xx[:, k].sum()
    N = xx.sum()
    notk = np.ones(self.K, dtype=np.bool)
    notk[k] = False
    zetak = logsumexp(self.psi[Ck])
    self.rho[k] = (self.psi[k] - zetak)
    muk_marg = (self.mu[k] - ((1.0 / self.Lambda[(k, k)]) * self.Lambda[(k, notk)].dot((self.psi[notk] - self.mu[notk]))))
    sigmak_marg = (1.0 / self.Lambda[(k, k)])
    omegak = self.omega[k]
    sigmak_cond = (1.0 / (omegak + (1.0 / sigmak_marg)))
    kappa = (Ck - (N / 2.0)).sum()
    muk_cond = (sigmak_cond * ((kappa + (muk_marg / sigmak_marg)) + (omegak * zetak)))
    return (muk_cond, sigmak_cond)

dataset/ETHPy150Open HIPS/pgmult/pgmult/distributions.py PGLogisticNormalMultinomial.conditional_psi/VarMisuse@99/158 `notk`->`Ck`