Negative log likelihood of probability distribution object
nll = negloglik(pd)
pd— Probability distribution
nll— Negative log likelihood
Negative log likelihood value for the data used to fit the distribution, returned as a scalar value.
Load the sample data.
Create a Weibull distribution object by fitting it to the mile per gallon (
pd = fitdist(MPG,'Weibull')
pd = WeibullDistribution Weibull distribution A = 26.5079 [24.8333, 28.2954] B = 3.27193 [2.79441, 3.83104]
Compute the negative log likelihood for the fitted Weibull distribution.
wnll = negloglik(pd)
wnll = 327.4942