- Timestamp:
- Mar 4, 2018 4:07:55 PM (7 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
- Children:
- 84ac3f1
- Parents:
- 943e17a
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
rbfeb823 ra7c6f38 365 365 # StaticText for chi2, N(for fitting), Npts + Log/linear spacing 366 366 self.tcChi = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 367 self.tcChi.SetToolTipString("Chi2/ Npts(Fit)")367 self.tcChi.SetToolTipString("Chi2/DOF (DOF=Npts-Npar fitted)") 368 368 self.Npts_fit = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 369 369 self.Npts_fit.SetToolTipString( … … 391 391 self.points_sizer.Add(self.pointsbox) 392 392 393 box_description_1 = wx.StaticText(self, wx.ID_ANY, ' Chi2/Npts')393 box_description_1 = wx.StaticText(self, wx.ID_ANY, 'Reduced Chi2') 394 394 box_description_2 = wx.StaticText(self, wx.ID_ANY, 'Npts(Fit)') 395 395 -
src/sas/sasgui/perspectives/fitting/media/fitting_help.rst
r5005ae0 ra7c6f38 426 426 See :ref:`Assessing_Fit_Quality`. 427 427 428 The objective of model-fitting is to find a *physically-plausible* model, and set429 of model parameters, that generate a theory that reproduces the experimental data 430 and gives residual values as close to zero as possible.428 The objective of model-fitting is to find a *physically-plausible* model, and 429 set of model parameters, that generate a theory that reproduces the experimental 430 data and minimizes the values of the residuals. 431 431 432 432 Change the default values of the model parameters by hand until the theory line 433 starts to represent the experimental data. Then uncheck the tick boxes alongside 434 all parameters *except* the 'background' and the 'scale'. Click the *Fit* button. 435 SasView will optimise the values of the 'background' and 'scale' and also display 436 the corresponding uncertainties on the optimised values. 437 438 *NB: If no uncertainty is shown it generally means that the model is not very* 439 *dependent on the corresponding parameter (or that one or more parameters are* 440 *'correlated').* 441 442 In the bottom left corner of the *Fit Page* is a box displaying the normalised value 443 of the statistical $\chi^2$ parameter returned by the optimiser. 433 starts to represent the experimental data. Then check the tick boxes alongside 434 the 'background' and the 'scale' parameters. Click the *Fit* button. SasView 435 will optimise the values of the 'background' and 'scale' and also display the 436 corresponding uncertainties on the optimised values. 437 438 .. note:: 439 If a parameter uncertainty is unrealistically large, or if it displays as 440 NaN either the model is a poor representation of the data, the parameter in 441 question is either highly correlated with one or more other fitted parameters 442 or at least that the model is relatively insensitive to the value of that 443 particular parameter. 444 445 In the bottom left corner of the *Fit Page* is a box displaying the normalised 446 value of the statistical $\chi^2$ parameter returned by the optimiser. 444 447 445 448 Now check the box for another model parameter and click *Fit* again. Repeat this 446 449 process until most or all parameters are checked and have been optimised. As the 447 fit of the theory to the experimental data improves the value of 'chi2/Npts' will448 decrease. A good model fit should easily produce values of 'chi2/Npts' that are450 fit of the theory to the experimental data improves, the value of 'Reduced Chi2' 451 will decrease. A good model fit should produce values of Reduced Chi2 close 449 452 close to one, and certainly <100. See :ref:`Assessing_Fit_Quality`. 450 453 … … 512 515 *FitPage*'s. 513 516 514 Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To 515 see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the 516 bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`. 517 Note that the Reduced Chi2 value returned is the SUM of the Reduced Chi2 of 518 each fit. To see the Reduced Chi2 value for a specific *FitPage*, click the 519 *Compute* button at the bottom of that *FitPage* to recalculate. Note that in 520 doing so the degrees of freedome will be set to Npts. 521 See :ref:`Assessing_Fit_Quality`. 517 522 518 523 Simultaneous Fits with Constraints … … 538 543 *FitPage*'s. 539 544 540 Note that the chi2/Npts value returned is the SUM of the chi2/Npts of each fit. To 541 see the chi2/Npts value for a specific *FitPage*, click the *Compute* button at the 542 bottom of that *FitPage* to recalculate. Also see :ref:`Assessing_Fit_Quality`. 543 545 Note that the Reduced Chi2 value returned is the SUM of the Reduced Chi2 of 546 each fit. To see the Reduced Chi2 value for a specific *FitPage*, click the 547 *Compute* button at the bottom of that *FitPage* to recalculate. Note that in 548 doing so the degrees of freedome will be set to Npts. 549 See :ref:`Assessing_Fit_Quality`. Moreover in the case of constraints the 550 degrees of freedom are less than one might think do to those constraints. 544 551 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 545 552 -
src/sas/sasgui/perspectives/fitting/media/residuals_help.rst
r99ded31 ra7c6f38 27 27 28 28 $\chi^2$ is a statistical parameter that quantifies the differences between 29 an observed data set and an expected dataset (or 'theory'). 30 31 When showing the a model with the data, *SasView* displays this parameter 32 normalized to the number of data points, $N_\mathrm{pts}$ such that 29 an observed data set and an expected dataset (or 'theory') calculated as 33 30 34 31 .. math:: 35 32 36 \chi^2 _N37 = \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_\mathrm{pts}33 \chi^2 34 = \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] 38 35 39 When performing a fit, *SasView* instead displays the reduced $\chi^2_R$, 40 which takes into account the number of fitting parameters $N_\mathrm{par}$ 41 (to calculate the number of 'degrees of freedom'). This is computed as 36 Fitting typically minimizes the value of $\chi^2$. However, for assessing the 37 quality of the model and its "fit" this parameter is not terribly helpful on its 38 own. Thus *SasView* instead displays a normalized version of this parameter, 39 using the traditional reduced $\chi^2_R$. This is the $\chi^2$ divided by the 40 degrees of freedom (or DOF). The DOF is simply the number of data points being 41 considered reduced by the number of free (i.e. fitted) parameters. Note that 42 model parameters that are kept fixed do *not* contribute to the DOF (they are 43 not"free". This reduced value is then given as 42 44 43 45 .. math:: … … 47 49 / [N_\mathrm{pts} - N_\mathrm{par}] 48 50 49 The normalized $\chi^2_N$ and the reduced $\chi^2_R$ are very close to each 50 other when $N_\mathrm{pts} \gg N_\mathrm{par}$. 51 where $N_\mathrm{par}$ is the number of *fitted* parameters. Note that this 52 means the displayed value will vary depending on the number of parameters used 53 in the fit. In particular, when doing a calculation without a fit (e.g. 54 manually changing a parameter) the DOF will now equal $N_\mathrm{pts}$ and the 55 $\chi^2_R$ will be the smallest possible for that combination of model, data 56 set and set of parameter values. 57 58 When $N_\mathrm{pts} \gg N_\mathrm{par}$ as it should for proper fitting, the 59 value of the reduced $\chi^2_R$ will not change very much. 51 60 52 61 For a good fit, $\chi^2_R$ tends to 1.
Note: See TracChangeset
for help on using the changeset viewer.