[ad2ce4e] | 1 | .. residuals_help.rst |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 5 | |
---|
| 6 | .. _Assessing_Fit_Quality: |
---|
| 7 | |
---|
| 8 | Assessing Fit Quality |
---|
| 9 | --------------------- |
---|
| 10 | |
---|
| 11 | When performing model-fits to some experimental data it is helpful to be able to |
---|
| 12 | gauge how good an individual fit is, how it compares to a fit of the *same model* |
---|
| 13 | *to another set of data*, or how it compares to a fit of a *different model to the* |
---|
| 14 | *same data*. |
---|
| 15 | |
---|
| 16 | One way is obviously to just inspect the graph of the experimental data and to |
---|
| 17 | see how closely (or not!) the 'theory' calculation matches it. But *SasView* |
---|
| 18 | also provides two other measures of the quality of a fit: |
---|
| 19 | |
---|
[5ed76f8] | 20 | * $\chi^2$ (or 'Chi2'; pronounced 'chi-squared') |
---|
[ad2ce4e] | 21 | * *Residuals* |
---|
| 22 | |
---|
| 23 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 24 | |
---|
| 25 | Chi2 |
---|
| 26 | ^^^^ |
---|
| 27 | |
---|
| 28 | Chi2 is a statistical parameter that quantifies the differences between an observed |
---|
| 29 | data set and an expected dataset (or 'theory'). |
---|
| 30 | |
---|
| 31 | *SasView* actually returns this parameter normalized to the number of data points, |
---|
| 32 | *Npts* such that |
---|
| 33 | |
---|
[5ed76f8] | 34 | .. math:: |
---|
[ad2ce4e] | 35 | |
---|
[940d034] | 36 | \chi^2/N_{pts} = \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_{pts} |
---|
[5ed76f8] | 37 | |
---|
| 38 | This differs slightly from what is sometimes called the 'reduced $\chi^2$' |
---|
[ad2ce4e] | 39 | because it does not take into account the number of fitting parameters (to |
---|
[5ed76f8] | 40 | calculate the number of 'degrees of freedom'), but the 'normalized $\chi^2$ |
---|
| 41 | and the 'reduced $\chi^2$ are very close to each other when $N_{pts} \gg |
---|
| 42 | \text{number of parameters}. |
---|
[ad2ce4e] | 43 | |
---|
[5ed76f8] | 44 | For a good fit, $\chi^2/N_{pts}$ tends to 1. |
---|
[ad2ce4e] | 45 | |
---|
[5ed76f8] | 46 | $\chi^2/N_{pts}$ is sometimes referred to as the 'goodness-of-fit' parameter. |
---|
[ad2ce4e] | 47 | |
---|
| 48 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 49 | |
---|
| 50 | Residuals |
---|
| 51 | ^^^^^^^^^ |
---|
| 52 | |
---|
| 53 | A residual is the difference between an observed value and an estimate of that |
---|
| 54 | value, such as a 'theory' calculation (whereas the difference between an observed |
---|
| 55 | value and its *true* value is its error). |
---|
| 56 | |
---|
[5ed76f8] | 57 | *SasView* calculates 'normalized residuals', $R_i$, for each data point in the |
---|
[ad2ce4e] | 58 | fit: |
---|
| 59 | |
---|
[5ed76f8] | 60 | .. math:: |
---|
| 61 | |
---|
| 62 | R_i = (Y_i - Y_theory_i) / (Y_err_i) |
---|
[ad2ce4e] | 63 | |
---|
[5ed76f8] | 64 | For a good fit, $R_i \sim 0$. |
---|
[ad2ce4e] | 65 | |
---|
| 66 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 67 | |
---|
| 68 | .. note:: This help document was last changed by Steve King, 08Jun2015 |
---|