%!demo
%! ## Compute the negative loglikelihood for a fitted Beta distribution
%! pd = makedist ("Beta", "a", 2, "b", 5)
%! rand ("seed", 22);
%! data = random (pd, 100, 1);
%! pd_fitted = fitdist (data, "Beta")
%! nlogL = negloglik (pd_fitted)
%!
%! ## This is useful for assessing the fit of a beta distribution to data,
%! ## lower values indicate a better fit.
