Zero-inflated Poisson likelihood

def zip(value=data, mu=mu, psi=psi):
    """ Zero-inflated Poisson likelihood """

    # Initialize likeihood
    like = 0.0

    # Loop over data
    for x in value:

        if not x:
            # Zero values
            like += np.log((1. - psi) + psi * np.exp(-mu))

        else:
            # Non-zero values
            like += np.log(psi) + poisson_like(x, mu)

    return like