Opened 7 months ago

Last modified 6 months ago

#895 new defect

user defined fit parameters for constrained fitting

Reported by: pkienzle Owned by:
Priority: major Milestone: SasView Next Release +1
Component: SasView Keywords:
Cc: Work Package: SasView GUI Enhancements


Sometimes users need to be able to create additional fitted parameters used to define other parameters in the system. For example, to fit the volume fraction of an sld mixture where the volume fraction is the same across the entire series, but the slds of the mixture components are different across the series, you want to define a parameter Vf and set:

    M1.sld = Vf*A1 +  (1-Vf)*B1
    M2.sld = Vf*A2 +  (1-Vf)*B2

where A1, B1, A2, B2, ... are known values. You then want to set limits on Vf to (0,1) and set it as a fitting parameter.

Change History (2)

comment:1 Changed 7 months ago by pkienzle

You can do this now, with some trickery:

  • Create a user defined model with parameter Vf=0 which returns 0*x+1.
  • Select the new plugin model, set background to 0 and number of points to 2 then recompute.
  • Freeze the theory function then load it into its own fit page.
  • Add that fit page to the simultaneous fit.
  • Use the Vf parameter to define other parameters as usual.

Because the returned value is independent of the parameters, the new fit page will not change the shape of the posterior probability distribution. The reported chisq will be slightly less than expected because the number of degrees of freedom is increased by the 2 fake data points, however, this will not be noticeable since DOF is already very large because of the number of points in SAS datasets.

Note that new parameter cannot be polydisperse.

comment:2 Changed 6 months ago by richardh

Also this could for example specify the number of points or convergence criterion to be used in an integration scheme for P(Q), if possible to return the last computed value of a derived parameter such as Debye length, or provide the value of a fixed constant used in the model calculation.

Note: See TracTickets for help on using tickets.