%!demo
%! ## Compute the negative loglikelihood for a fitted Rayleigh distribution
%! rand ("seed", 21);
%! data = raylrnd (1, 100, 1);
%! pd_fitted = fitdist (data, "Rayleigh");
%! nlogL = negloglik (pd_fitted)
%!
%! ## This is useful for assessing the fit of a Rayleigh distribution to
%! ## data, with lower values indicating a better fit, often used in model comparison.
