---
title: "Using Goodness-of Fit Statistics to optimise Distribution Fitting"
canonical: "https://modelassist.epixanalytics.com/space/EA/26575337/Using%20Goodness-of%20Fit%20Statistics%20to%20optimise%20Distribution%20Fitting"
format: markdown
---
Goodness of fit statistics can be used with a linear optimizer to find the parameters that produce the closest fit of a distribution to the observed data. The technique proceeds as follows:

  


1.     The MLE of the fitted distribution (or any reasonable guess for the best fit parameter) is determined.

2.     A spreadsheet is written that calculates the relevant goodness-of-fit statistic with the MLE displayed in a separate cell

3.     Using the Solver in Excel, the value of the parameter is varied to produce a minimum value for the goodness-of-fit statistic. The parameter value  that produces that minimum is then used instead of the original estimator.

  


In fact for normal statistical applications, the MLE is a [far better estimate](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575336/) than a parameter value that minimizes a goodness-of-fit statistic. However, this technique does offer the advantage of allowing the analyst to select or develop his/her own measure of goodness-of-fit and then to find the parameters that optimize that measure.

  


  


  


---