def log_likelihood_rankings(data, params):
loglik = <NUM_LIT:0><EOL>params = np.asarray(params)<EOL>for ranking in data:<EOL><INDENT>for i, winner in enumerate(ranking[:-<NUM_LIT:1>]):<EOL><INDENT>loglik -= logsumexp(params.take(ranking[i:]) - params[winner])<EOL><DEDENT><DEDENT>return loglik<EOL>
Compute the log-likelihood of model parameters.