

def plot_lds_results(X, z_mean, z_std, pis):
    plt.figure()
    ax1 = plt.subplot(311)
    plt.errorbar(z_mean[:, 0], color='r', yerr=z_std[:, 0])
    plt.errorbar(z_mean[:, 1], ls='--', color='r', yerr=z_std[:, 1])
    ax1.set_title('True and inferred latent states')
    ax2 = plt.subplot(312)
    plt.imshow(X.T, interpolation='none', vmin=0, vmax=1, cmap='Blues')
    ax2.set_title('Observed counts')
    ax4 = plt.subplot(313)
    N_samples = pis.shape[0]
    plt.imshow(pis[(N_samples // 2):, ...].mean(0).T, interpolation='none', vmin=0, vmax=1, cmap='Blues')
    ax4.set_title('Mean inferred probabilities')
    plt.show()

dataset/ETHPy150Open HIPS/pgmult/examples/multinomial_lds_2.py plot_lds_results/original