

def resample_omega(self, augmented_data_list):
    '\n        Resample omega from its conditional Polya-gamma distribution\n        :return:\n        '
    K = self.K
    for data in augmented_data_list:
        x = data['x']
        T = data['T']
        if ('z' in data):
            z = data['z']
        elif ('states' in data):
            z = data['states'].stateseq
        else:
            raise Exception('Could not find latent states in augmented data!')
        psi = (z.dot(T.C.T) + self.mu[None, :])
        N = N_vec(x).astype(np.float)
        tmp_omg = np.zeros(N.size)
        ppg.pgdrawvpar(self.ppgs, N.ravel(), psi.ravel(), tmp_omg)
        data['omega'] = tmp_omg.reshape((T, (self.K - 1)))
        data['omega'] = np.clip(data['omega'], 1e-08, np.inf)

dataset/ETHPy150Open HIPS/pgmult/pgmult/distributions.py PGMultinomialRegression.resample_omega/VarMisuse@95/170 `self`->`T`