%!demo
%! ## Compute the negative loglikelihood for a fitted Nakagami distribution
%! rand ("seed", 21);
%! data = nakarnd (1, 1, 100, 1);
%! pd_fitted = fitdist (data, "Nakagami");
%! params = [pd_fitted.mu, pd_fitted.omega];
%! nlogL_nakalike = nakalike (params, data)
%!
%! ## This is useful for assessing the fit of a Nakagami distribution to data,
%! ## with lower values indicating a better fit, often used in model comparison.
