function nll=nllLogit(coef);

global Y X

nll=sum(Y.*-log(1./(1+exp(-X*coef))) + (1-Y).*-log(1-(1./(1+exp(-X*coef)))));
