Fitting a probability distribution to data with the maximum likelihood method