You can start by creating a custom probability distribution object that includes the necessary methods for calculating the negative log likelihood. Since you are using a power-law distribution, you've already implemented the logarithm of the probability density function (‘...
Generalized negative log likelihood and Viterbi algorithms
Negative truncated log-likelihood functionLars SnipenKristian Hovde Liland
Log-likelihood function for the fixed-effects modelMaurizio ManuguerraGillian Heller