Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up how FitPage parameter table reflects array distributions #1839

Open
smk78 opened this issue May 7, 2021 · 4 comments
Open

Tidy up how FitPage parameter table reflects array distributions #1839

smk78 opened this issue May 7, 2021 · 4 comments
Labels
Defect Bug or undesirable behaviour Enhancement Feature requests and/or general improvements Good First Issue Issues that are appropriate for newbies
Milestone

Comments

@smk78
Copy link
Contributor

smk78 commented May 7, 2021

When polydispersity is enabled in a model, selected parameters can take on distributions of values. Array distributions (basically a simple file of weight values as a function of the chosen parameter, such as a radius) allow the User greater flexibility over the form of the distribution to be applied than simply using the built-in dispersity functions (Gaussian, Lognormal, etc), without the complexity of custom-defined distribution functions which require some coding.

The caveat is that, unlike the built-in or custom distributions, array distributions are utilised 'as supplied'; sasmodels does not shift or scale the distribution, meaning it cannot be fit/optimised. This is stated in the help docs. However, this is not reflected in the FitPage.

The unobservant User could easily miss that the parameter using an array distribution is not changing and, worse, believe that that parameter displayed actually has some meaning. It does not! This needs rectifying.

Discussions with @butlerpd and @pkienzle have suggested two options:

  • the quick fix would be to simply clear any values and 'grey out' the parameter that is using an array distribution.

  • a better fix would be to return some meaningful value characterising the chosen array distribution to the parameter table (though it would not be a fittable parameter for the reason above); the mean of the distribution would be one such parameter.

On this latter point @pkienzle comments:
image

The help docs for array distributions would also need updating to reflect any change made in the process of dealing with this issue.

@smk78 smk78 added Defect Bug or undesirable behaviour SasView GUI Enhancements Documentation Concerns documentation Good First Issue Issues that are appropriate for newbies labels May 7, 2021
@smk78 smk78 added this to the SasView 5.0.5 milestone May 7, 2021
@smk78
Copy link
Contributor Author

smk78 commented May 7, 2021

@pkienzle comments:
Maybe add something like the follow to the docs (suitably translated to English):

Consider a sample which is a mixture of monodisperse spheres of radius 40 with an equal mass of spheres of radius 80, then in terms of number density you have 1 part 80 for 8 parts 40, giving an array distribution of [40, 8], [80, 1]. This is what sasmodels uses when combining the two I(q).

For continuous distributions, you can use a simple rectangle rule integration with equally spaced x and weight w(x) chosen at the center of each interval. If you use unequally spaced intervals then choose the weight value as the entire density within each interval, and set the the center value to the weighted mean of the interval.

This applies equally to user defined distributions and to array distributions.

@smk78
Copy link
Contributor Author

smk78 commented May 7, 2021

@pkienzle also comments:
image

@smk78
Copy link
Contributor Author

smk78 commented May 7, 2021

Also see #1213

@smk78
Copy link
Contributor Author

smk78 commented Nov 3, 2021

Doc updates are complete, but the wider issue mentioned remains. Removing the SasView Documentation label but leaving the issue open.

@smk78 smk78 removed the Documentation Concerns documentation label Nov 5, 2021
@butlerpd butlerpd modified the milestones: SasView 5.0.5, SasView 5.1.0 Feb 1, 2022
@lucas-wilkins lucas-wilkins added Enhancement Feature requests and/or general improvements and removed SasView GUI Enhancements labels Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Bug or undesirable behaviour Enhancement Feature requests and/or general improvements Good First Issue Issues that are appropriate for newbies
Projects
None yet
Development

No branches or pull requests

3 participants