%Calculates the logLikelihood of the ratings

%pdfs is a matrix of distributions for each product
% (ie. a column is a pdf over ratings for the that product)
%ratings is the ratings vector, where missing values are 0
%Note: only indices with values in ratings are used on pdf

function result = logLikelihood(pdfs,ratings,heldOutIndices)
 result = 0;
 for i=heldOutIndices
   result = result - log(pdfs(ratings(i),i));
 end

