<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nll(data, model):
 """ Negative log likelihood given data and a model Parameters {0} {1} Returns ------- float Negative log likelihood Examples --------- 237.6871819262054 235.2841347820297 """


    try:
        log_lik_vals = model.logpmf(data)
    except:
        log_lik_vals = model.logpdf(data)
    return -np.sum(log_lik_vals)