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

Passing additional computed, non-fitting, parameter values back from models (Trac #1126) #182

Open
RichardHeenan opened this issue Mar 30, 2019 · 3 comments

Comments

@RichardHeenan
Copy link
Contributor

RichardHeenan commented Mar 30, 2019

Would be good for constraints on S(Q) radius and phi to be able to access ER and VR values from preceding P(Q) model, preferably without making models too much more complicated. Likely more than one possible type of ER, see SasView/sasview#888 and SasView/sasview#1160.

Would be good for some models to return usful information to users, e.g. Debye lengths from hayter_msa S(Q).

Paul K says that this might not be simple, but he has some ideas.

Migrated from http://trac.sasview.org/ticket/1126

{
    "status": "new",
    "changetime": "2018-09-09T07:48:00",
    "_ts": "2018-09-09 07:48:00.382836+00:00",
    "description": "Would be good for constraints on S(Q) radius and phi to be able to access ER and VR values from preceding P(Q) model, preferably without making models too much more complicated. Likely more than one possible type of ER, see #780 and #1115.\n\nWould be good for some models to return usful information to users, e.g. Debye lengths from hayter_msa S(Q).\n\nPaul K says that this might not be simple, but he has some ideas.",
    "reporter": "richardh",
    "cc": "",
    "resolution": "",
    "workpackage": "Beta Approximation Project",
    "time": "2018-07-03T16:20:22",
    "component": "sasmodels",
    "summary": "Passing additional computed, non-fitting, parameter values back from models",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView Next Release +1",
    "owner": "richardh",
    "type": "enhancement"
}
@pkienzle
Copy link
Contributor

Trac update at 2018/07/05 19:38:55: pkienzle commented:

Some issues:

(1) don't want to calculate these values during fits unless they are needed

(2) some of these values (e.g., ER) will be evaluated over parameter distributions

(3) how should these values be displayed in the user interface?

Should be able to set up a new type of parameter in the parameter table as a derived value, giving it a name, units and description. There will be no limits or default. Could set the type to be 'derived', and set 'limits' as the function, much like limits=[OPTION_LIST] is used for a list of options.

The function needs to accept a parameter table with parameter values and weights. If called with a distribution of values, then the average will need to be returned. Unlike the current ER call the complete parameter table may be needed, depending on what is calculated, not just the volume parameters. Passing the call details and parameter values vector to the function wrapper would give enough information.

Need to update DirectModel, BumpsModel and SasviewModel to prepare the inputs and call the function when the parameter value is requested. Need to update the mixture model and product model to break the parameters into parts for the individual functions. There is a risk of circularity: if parameter a depends on ER which depends on parameter b, we can't request ER without triggering a request for a. The solution should avoid repeating the expensive operation of setting up and tearing apart the parameters for the function call.

@sasview-bot
Copy link

Trac update at 2018/09/09 07:48:00: tcbennun commented:

The sasmodels branch beta_approx_new_R_eff contains functionality to pass back the computed ER, as detailed in SasView/sasview#888. However, this mechanism is not generic, so new code needs to be added into the kernel and surrounding architecture, e.g. generate.py, for any new computed quantities to be passed back.

@pkienzle pkienzle modified the milestones: SasView Next Release +1, sasmodels Next Release +1 Mar 31, 2019
@pkienzle
Copy link
Contributor

It may be useful to see the underlying kernel parameters for reparameterized shapes, such as a sphere defined by volume rather than radius, allowing users to see the average radius for particles with the given volume distribution (see #211).

Maybe want to impose inequality constraints on these values (e.g., shell thickness in [10, 20] when shell volume is percentage of total volume).

In addition to average volume and effective radius, could also compute average Rg. This needs to be normalized by weight times volume squared rather than volume, so would probably be a special case (https://lookingatnothing.com/wp-content/uploads/2010/12/Guinier_short.pdf).

Don't forget that the derived parameters need to be carried forward into interaction and mixture models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment