function negloglikelihood = NegLogLikelihood(data,model)
% NegLogLikelihood(data,model)
% Evaluates the likelihood of the given data and model.
% data is an array. model is a simple binomial with noise, quantal variance and stim failures

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

tmp = BinomPDF(model,data);
logPDF = log(tmp);
negloglikelihood = -sum(logPDF);







