% LOGISTIC REGRESSION LOG LIKELIHOOD.  Computes the log probability of the
% training data with inputs X and targets y, using the parameters in beta.

function loglike = lrloglike (y, X, beta)

  ys = 2*y-1;

  lin = beta(1) + X * beta(2:end)';
  loglike = sum (-log(1+exp(-ys.*lin)));
