Changeset 84ac3f1 in sasview


Ignore:
Timestamp:
Mar 4, 2018 10:14:20 PM (7 years ago)
Author:
butler
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
47ace50
Parents:
a7c6f38
Message:

More Edits

Clean up new documentation as well as fix older incorrect documention on
simultaneous/constrained fitting.

Location:
src/sas/sasgui/perspectives/fitting/media
Files:
2 edited

Legend:

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

    ra7c6f38 r84ac3f1  
    432432Change the default values of the model parameters by hand until the theory line 
    433433starts to represent the experimental data. Then check the tick boxes alongside 
    434 the 'background' and the 'scale' parameters. Click the *Fit* button. SasView 
     434the 'background' and 'scale' parameters. Click the *Fit* button. SasView 
    435435will optimise the values of the 'background' and 'scale' and also display the 
    436436corresponding uncertainties on the optimised values. 
    437437 
    438438.. 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. 
     439   If the uncertainty on a fitted parameter is unrealistically large, or if it 
     440   displays as NaN, the model is most likely a poor representation of the data, 
     441   the parameter in question is highly correlated with one or more of the other 
     442   fitted parameters, or the model is relatively insensitive to the value of 
     443   that particular parameter. 
    444444 
    445445In the bottom left corner of the *Fit Page* is a box displaying the normalised 
     
    447447 
    448448Now check the box for another model parameter and click *Fit* again. Repeat this 
    449 process until most or all parameters are checked and have been optimised. As the 
    450 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 
    452 close to one, and certainly <100. See :ref:`Assessing_Fit_Quality`. 
     449process until all relevant parameters are checked and have been optimised. As 
     450the fit of the theory to the experimental data improves, the value of 'Reduced 
     451Chi2' will decrease. A good model fit should produce values of Reduced Chi2 
     452close to one, and certainly << 100. See :ref:`Assessing_Fit_Quality`. 
    453453 
    454454SasView has a number of different optimisers (see the section :ref:`Fitting_Options`). 
     
    465465*the Data Explorer is checked (see the section* :ref:`Loading_data` *).* 
    466466 
    467 This mode is an extension of the :ref:`Single_Fit_Mode` that fits two or more data 
    468 sets *to the same model* simultaneously. If necessary it is possible to constrain 
    469 fit parameters between data sets (eg, to fix a background level, or radius, etc). 
     467This mode is an extension of the :ref:`Single_Fit_Mode` that allows for some 
     468relatively extensive constraints between fitted parameters in a single *FitPage* 
     469or between several *FitPage*'s (eg, to constrain all fitted parameters to be the 
     470same in a contrast series of *FitPages* except for the solvent sld parameter, 
     471contrain the length to be twice that of the radius in a single *FitPage*, 
     472fix the radius of the sphere in one *FitPage* to be the same as the radius of 
     473the cylinder in a second *FitPage*, etc). 
    470474 
    471475If the data to be fit are in multiple files, load each file, then select each file 
     
    504508next to *Add Constraint?* in the *Fit Constraints* box. 
    505509 
     510To constrain all identically named parameters to fit *simultaneously* to the 
     511same value across all the *Fitpages* use the *Easy Setup* drop-down buttons in 
     512the *Const & Simul Fit* page. 
     513 
    506514*NB: You can only constrain parameters that are set to refine.* 
     515 
     516Constraints will generally be of the form 
     517 
     518  Mi Parameter1 = Mj.Parameter1 
     519 
     520however the text box after the '=' sign can be used to adjust this 
     521relationship; for example 
     522 
     523  Mi Parameter1 = scalar \* Mj.Parameter1 
     524 
     525A 'free-form' constraint box is also provided. 
     526 
     527Many constraints can be entered for a single fit. 
    507528 
    508529When ready, click the *Fit* button on the *Const & Simul Fit* page, NOT the *Fit* 
    509530button on the individual *FitPage*'s. 
    510  
    511 Simultaneous Fits without Constraints 
    512 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    513531 
    514532The results of the model-fitting will be returned to each of the individual 
     
    518536each fit. To see the Reduced Chi2 value for a specific *FitPage*, click the  
    519537*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`. 
    522  
    523 Simultaneous Fits with Constraints 
    524 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    525  
    526 Use the *Easy Setup* drop-down buttons in the *Const & Simul Fit* page to set 
    527 up constraints between *FitPage*'s. 
    528  
    529 Constraints will generally be of the form 
    530  
    531   Mi Parameter1 = Mj.Parameter1 
    532  
    533 however the text box after the '=' sign can be used to adjust this 
    534 relationship; for example 
    535  
    536   Mi Parameter1 = scalar \* Mj.Parameter1 
    537  
    538 A 'free-form' constraint box is also provided. 
    539  
    540 Many constraints can be entered for a single fit. 
    541  
    542 The results of the model-fitting will be returned to each of the individual 
    543 *FitPage*'s. 
    544  
    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. 
     538doing so the degrees of freedom will be set to Npts. 
    549539See :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. 
     540degrees of freedom are less than one might think due to those constraints. 
     541 
    551542.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    552543 
     
    773764.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    774765 
    775 .. note::  This help document was last changed by Paul Butler, 10 September 
    776    2017 
     766.*Document History* 
     767 
     768| 2017-09-10 Paul Butler 
     769| 2017-09-15 Steve King 
     770| 2018-03-05 Paul Butler 
  • src/sas/sasgui/perspectives/fitting/media/residuals_help.rst

    ra7c6f38 r84ac3f1  
    3434  =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] 
    3535 
    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 
     36Fitting typically minimizes the value of $\chi^2$.  For assessing the quality of 
     37the model and its "fit" however, *SasView* displays the traditional reduced 
     38$\chi^2_R$ which normalizes this parameter by dividing it by the number of 
     39degrees of freedom (or DOF). The DOF is the number of data points being 
     40considered, $N_\mathrm{pts}$, reduced by the number of free (i.e. fitted) 
     41parameters, $N_\mathrm{par}$. Note that model parameters that are kept fixed do 
     42*not* contribute to the DOF (they are not "free"). This reduced value is then 
     43given as 
    4444 
    4545.. math:: 
     
    4949  / [N_\mathrm{pts} - N_\mathrm{par}] 
    5050 
    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. 
     51Note that this means the displayed value will vary depending on the number of 
     52parameters used in the fit. In particular, when doing a calculation without a 
     53fit (e.g. manually changing a parameter) the DOF will now equal $N_\mathrm{pts}$ 
     54and the $\chi^2_R$ will be the smallest possible for that combination of model, 
     55data set, and set of parameter values. 
    5756 
    5857When $N_\mathrm{pts} \gg N_\mathrm{par}$ as it should for proper fitting, the 
     
    9998| 2015-06-08 Steve King 
    10099| 2017-09-28 Paul Kienzle 
     100| 2018-03-04 Paul Butler 
Note: See TracChangeset for help on using the changeset viewer.