%!demo
%! ## Compute the negative loglikelihood for a fitted Binomial distribution
%! pd = makedist ("Binomial", "N", 10, "p", 0.3)
%! rand ("seed", 22);
%! data = random (pd, 100, 1);
%! pd_fitted = fitdist (data, "Binomial", "ntrials", 10)
%! nlogL = negloglik (pd_fitted)
%!
%! ## This is useful for assessing the fit of a binomial distribution to data,
%! ## lower values indicate a better fit.
