%!demo
%! ## Compute the negative loglikelihood for a fitted Half-normal distribution
%! rand ("seed", 21);
%! data = abs (randn (100, 1));
%! pd_fitted = fitdist (data, "HalfNormal");
%! params = [pd_fitted.mu, pd_fitted.sigma];
%! nlogL_hnlike = hnlike (params, data)
%!
%! ## This is useful for assessing the fit of a Half-normal distribution to
%! ## data, with lower values indicating a better fit, often used in model comparison.
