Robust Model Fitting
#######################

Robust model fitting attempts to find the best fit model to observations under the assumption that a few of the observations are generated by noise. If those noisy observations are included in standard model fitting approaches the final solution will be extremely inaccurate. Thus a robust model fitting algorithm finds the best fit parameters and the set of observations which are not generated by noise. Please checkout all the example code since this example reilies on additional classes directory.

:gitexample:`ExampleRobustModelFit.java`

.. literalinclude:: ../../examples/src/org/ddogleg/example/ExampleRobustModelFit.java
   :language: java
   :linenos:
   :start-after: public class
   :tab-width: 4
   :dedent: 4

Below are all the support classes which define the model being fitted and perform data management.

.. literalinclude:: ../../examples/src/org/ddogleg/example/Line2D.java
   :language: java
   :linenos:
   :lines: 37-
   :tab-width: 4
   :dedent: 0

.. literalinclude:: ../../examples/src/org/ddogleg/example/DistanceFromLine.java
   :language: java
   :linenos:
   :lines: 31-
   :tab-width: 4
   :dedent: 0

.. literalinclude:: ../../examples/src/org/ddogleg/example/LineGenerator.java
   :language: java
   :linenos:
   :lines: 30-
   :tab-width: 4
   :dedent: 0
