### How to estimate errors of a fit

#### Online utility to generate Monte Carlo error estimations...

You can submit your "filename MonteCarlo.txt" data for analysis : select the file from download and press execute...

The Python script that is executed from the web page is available on GitHub in the pydmfit package on GitHub

Run on of the following examples or submit your own file below...

#### During the standard fitting procedure

During the fitting procedure the program provides a basic estimation of errors/reliabilty of the computed parameters in the right part of the display and at the end of the fitting procedure. These values are not errors strictly speaking, they are related to the latest increment computed by the optimization algorithm.

#### from a Monte Carlo procedure

** dmfit** also provide a means of carrying out a statistical analysis of the fit and of the stability of the model through a Monte Carlo procedure.
The resulting parameters are saved in an ascii file named from the current fitname ("fname MonteCarlo.txt") that can be easily processed in Excell or by other programs.

- addition of random noise to the spectrum (or to the model)
- fit of the parameters
- restoration of the initial values

##### Generating the Monte Carlo data from *dmfit*

*dmfit*

- load a spectrum and a fit
- fit the existing data (you'll have and error otherwize)
- call [Menu/Decomposition/Auto Fit/Monte Carlo errors Spec] or [Menu/Decomposition/Auto Fit/Monte Carlo errors Model]
- choose the number of iterations (large number - hundreds - is required for a reliable output)
- the results are added to the "filename MonteCarlo.txt" file...

##### Analysing the Monte Carlo data...

From the results stored in the "fname MonteCarlo.txt" file generated you can compute the average and standard deviation (sdev) values where the error bar is a multiple of the standard deviation depending of the required confidence level (+/- sdev for a confidence of 68%, +/- 2 sdev for a confidence of 95% see Wikipedia for more.