Ignore:
Timestamp:
Sep 28, 2017 3:29:35 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
64cdb0d
Parents:
5005ae0
Message:

improve description of 'fitting quality' and clean up latex formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/media/residuals_help.rst

    r940d034 r99ded31  
    2626^^^^ 
    2727 
    28 Chi2 is a statistical parameter that quantifies the differences between an observed 
    29 data set and an expected dataset (or 'theory'). 
     28$\chi^2$ is a statistical parameter that quantifies the differences between 
     29an observed data set and an expected dataset (or 'theory'). 
    3030 
    31 *SasView* actually returns this parameter normalized to the number of data points, 
    32 *Npts* such that 
     31When showing the a model with the data, *SasView* displays this parameter 
     32normalized to the number of data points, $N_\mathrm{pts}$ such that 
    3333 
    3434.. math:: 
    3535 
    36   \chi^2/N_{pts} =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_{pts} 
     36  \chi^2_N 
     37  =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_\mathrm{pts} 
    3738 
    38 This differs slightly from what is sometimes called the 'reduced $\chi^2$' 
    39 because it does not take into account the number of fitting parameters (to 
    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}. 
     39When performing a fit, *SasView* instead displays the reduced $\chi^2_R$, 
     40which takes into account the number of fitting parameters $N_\mathrm{par}$ 
     41(to calculate the number of 'degrees of freedom'). This is computed as 
    4342 
    44 For a good fit, $\chi^2/N_{pts}$ tends to 1. 
     43.. math:: 
    4544 
    46 $\chi^2/N_{pts}$ is sometimes referred to as the 'goodness-of-fit' parameter. 
     45  \chi^2_R 
     46  =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] 
     47  / [N_\mathrm{pts} - N_\mathrm{par}] 
     48 
     49The normalized $\chi^2_N$ and the reduced $\chi^2_R$ are very close to each 
     50other when $N_\mathrm{pts} \gg N_\mathrm{par}$. 
     51 
     52For a good fit, $\chi^2_R$ tends to 1. 
     53 
     54$\chi^2_R$ is sometimes referred to as the 'goodness-of-fit' parameter. 
    4755 
    4856.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    5260 
    5361A 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). 
     62value, such as a 'theory' calculation (whereas the difference between an 
     63observed value and its *true* value is its error). 
    5664 
    5765*SasView* calculates 'normalized residuals', $R_i$, for each data point in the 
     
    6068.. math:: 
    6169 
    62   R_i = (Y_i - Y_theory_i) / (Y_err_i) 
     70  R_i = (Y_i - \mathrm{theory}_i) / \mathrm{error}_i 
    6371 
    64 For a good fit, $R_i \sim 0$. 
     72Think of each normalized residual as the number of standard deviations 
     73between the measured value and the theory.  For a good fit, 68% of $R_i$ 
     74will be within one standard deviation, which will show up in the Residuals 
     75plot as $R_i$ values between $-1$ and $+1$.  Almost all the values should 
     76be between $-3$ and $+3$. 
     77 
     78Residuals values larger than $\pm 3$ indicate that the model 
     79is not fit correctly, the wrong model was chosen (e.g., because there is 
     80more than one phase in your system), or there are problems in 
     81the data reduction.  Since the goodness of fit is calculated from the 
     82sum-squared residuals, these extreme values will drive the choice of fit 
     83parameters.  Any uncertainties calculated for the fitting parameters will 
     84be meaningless. 
    6585 
    6686.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    6787 
    68 .. note::  This help document was last changed by Steve King, 08Jun2015 
     88*Document History* 
     89 
     90| 2015-06-08 Steve King 
     91| 2017-09-28 Paul Kienzle 
Note: See TracChangeset for help on using the changeset viewer.