%!demo
%! ## Compute the negative loglikelihood for a fitted Birnbaum-Saunders distribution
%! pd = makedist ("BirnbaumSaunders", "beta", 1, "gamma", 0.5)
%! randg ("seed", 21);
%! data = random (pd, 100, 1);
%! pd_fitted = fitdist (data, "BirnbaumSaunders")
%! nlogL = negloglik (pd_fitted)
%!
%! ## This is useful for assessing the fit of a Birnbaum-Saunders distribution to
%! ## data, lower values indicate a better fit.
