def poisson_log_like(counts, model):
    """Compute the Poisson log-likelihood function for the given
    counts and model arrays."""
    loglike = np.array(model)
    m = counts > 0
    loglike[m] -= counts[m] * np.log(model[m])
    return loglike