function l = LogLikVectorized(params,Pobs,model,interp,options,purge)
% LOGLIKVECTORIZED vectorizes the evaluation of the log-likelihood, allowing parallel evaluation

l = NaN(length(Pobs),size(params,2));
parfor(i=1:size(params,2), options.ncpu)
  try
    l(:,i) = LogLikelihood(params(:,i),Pobs,model,interp,options,purge);
  catch
    l(:,i) = NaN;
  end
end

