# Changeset 84ac3f1 in sasview

Ignore:
Timestamp:
Mar 4, 2018 10:14:20 PM (5 years ago)
Branches:
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
 ra7c6f38 Change the default values of the model parameters by hand until the theory line starts to represent the experimental data. Then check the tick boxes alongside the 'background' and the 'scale' parameters. Click the *Fit* button. SasView the 'background' and 'scale' parameters. Click the *Fit* button. SasView will optimise the values of the 'background' and 'scale' and also display the corresponding uncertainties on the optimised values. .. note:: If a parameter uncertainty is unrealistically large, or if it displays as NaN either the model is a poor representation of the data, the parameter in question is either highly correlated with one or more other fitted parameters or at least that the model is relatively insensitive to the value of that particular parameter. If the uncertainty on a fitted parameter is unrealistically large, or if it displays as NaN, the model is most likely a poor representation of the data, the parameter in question is highly correlated with one or more of the other fitted parameters, or the model is relatively insensitive to the value of that particular parameter. In the bottom left corner of the *Fit Page* is a box displaying the normalised Now check the box for another model parameter and click *Fit* again. Repeat this process until most or all parameters are checked and have been optimised. As the fit of the theory to the experimental data improves, the value of 'Reduced Chi2' will decrease. A good model fit should produce values of Reduced Chi2 close close to one, and certainly <100. See :ref:Assessing_Fit_Quality. process until all relevant parameters are checked and have been optimised. As the fit of the theory to the experimental data improves, the value of 'Reduced Chi2' will decrease. A good model fit should produce values of Reduced Chi2 close to one, and certainly << 100. See :ref:Assessing_Fit_Quality. SasView has a number of different optimisers (see the section :ref:Fitting_Options). *the Data Explorer is checked (see the section* :ref:Loading_data *).* This mode is an extension of the :ref:Single_Fit_Mode that fits two or more data sets *to the same model* simultaneously. If necessary it is possible to constrain fit parameters between data sets (eg, to fix a background level, or radius, etc). This mode is an extension of the :ref:Single_Fit_Mode that allows for some relatively extensive constraints between fitted parameters in a single *FitPage* or between several *FitPage*'s (eg, to constrain all fitted parameters to be the same in a contrast series of *FitPages* except for the solvent sld parameter, contrain the length to be twice that of the radius in a single *FitPage*, fix the radius of the sphere in one *FitPage* to be the same as the radius of the cylinder in a second *FitPage*, etc). If the data to be fit are in multiple files, load each file, then select each file next to *Add Constraint?* in the *Fit Constraints* box. To constrain all identically named parameters to fit *simultaneously* to the same value across all the *Fitpages* use the *Easy Setup* drop-down buttons in the *Const & Simul Fit* page. *NB: You can only constrain parameters that are set to refine.* Constraints will generally be of the form Mi Parameter1 = Mj.Parameter1 however the text box after the '=' sign can be used to adjust this relationship; for example Mi Parameter1 = scalar \* Mj.Parameter1 A 'free-form' constraint box is also provided. Many constraints can be entered for a single fit. When ready, click the *Fit* button on the *Const & Simul Fit* page, NOT the *Fit* button on the individual *FitPage*'s. Simultaneous Fits without Constraints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The results of the model-fitting will be returned to each of the individual each fit. To see the Reduced Chi2 value for a specific *FitPage*, click the *Compute* button at the bottom of that *FitPage* to recalculate. Note that in doing so the degrees of freedome will be set to Npts. See :ref:Assessing_Fit_Quality. Simultaneous Fits with Constraints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the *Easy Setup* drop-down buttons in the *Const & Simul Fit* page to set up constraints between *FitPage*'s. Constraints will generally be of the form Mi Parameter1 = Mj.Parameter1 however the text box after the '=' sign can be used to adjust this relationship; for example Mi Parameter1 = scalar \* Mj.Parameter1 A 'free-form' constraint box is also provided. Many constraints can be entered for a single fit. The results of the model-fitting will be returned to each of the individual *FitPage*'s. Note that the Reduced Chi2 value returned is the SUM of the Reduced Chi2 of each fit. To see the Reduced Chi2 value for a specific *FitPage*, click the *Compute* button at the bottom of that *FitPage* to recalculate. Note that in doing so the degrees of freedome will be set to Npts. doing so the degrees of freedom will be set to Npts. See :ref:Assessing_Fit_Quality.  Moreover in the case of constraints the degrees of freedom are less than one might think do to those constraints. degrees of freedom are less than one might think due to those constraints. .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ .. note::  This help document was last changed by Paul Butler, 10 September 2017 .*Document History* | 2017-09-10 Paul Butler | 2017-09-15 Steve King | 2018-03-05 Paul Butler
 ra7c6f38 =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] Fitting typically minimizes the value of $\chi^2$.  However, for assessing the quality of the model and its "fit" this parameter is not terribly helpful on its own.  Thus *SasView* instead displays a normalized version of this parameter, using the traditional reduced $\chi^2_R$.  This is the $\chi^2$ divided by the degrees of freedom (or DOF). The DOF is simply the number of data points being considered reduced by the number of free (i.e. fitted) parameters. Note that model parameters that are kept fixed do *not* contribute to the DOF (they are not"free". This reduced value is then given as Fitting typically minimizes the value of $\chi^2$.  For assessing the quality of the model and its "fit" however, *SasView* displays the traditional reduced $\chi^2_R$ which normalizes this parameter by dividing it by the number of degrees of freedom (or DOF). The DOF is the number of data points being considered, $N_\mathrm{pts}$, reduced by the number of free (i.e. fitted) parameters, $N_\mathrm{par}$. Note that model parameters that are kept fixed do *not* contribute to the DOF (they are not "free"). This reduced value is then given as .. math:: / [N_\mathrm{pts} - N_\mathrm{par}] where $N_\mathrm{par}$ is the number of *fitted* parameters. Note that this means the displayed value will vary depending on the number of parameters used in the fit.  In particular, when doing a calculation without a fit (e.g. manually changing a parameter) the DOF will now equal $N_\mathrm{pts}$ and the $\chi^2_R$ will be the smallest possible for that combination of model, data set and set of parameter values. Note that this means the displayed value will vary depending on the number of parameters used in the fit. In particular, when doing a calculation without a fit (e.g. manually changing a parameter) the DOF will now equal $N_\mathrm{pts}$ and the $\chi^2_R$ will be the smallest possible for that combination of model, data set, and set of parameter values. When $N_\mathrm{pts} \gg N_\mathrm{par}$ as it should for proper fitting, the | 2015-06-08 Steve King | 2017-09-28 Paul Kienzle | 2018-03-04 Paul Butler