rs-station / careless

Merge X-ray diffraction data with Wilson's priors, variational inference, and metadata
MIT License
16 stars 6 forks source link

the 'spacegroup trick' and weighting observations in the NLL #117

Closed DHekstra closed 1 year ago

DHekstra commented 1 year ago

This is mainly an observation: for EFX experimental analysis, we commonly include the OFF data in both the higher and lower-symmetry spacegroup. As a result, we inevitably include the same observations twice in the calculation of the NLL, while the ON data are usually included once. This means that the OFF data exert a disproportionate effect on the scale function, as their effective measurement error is effectively divided by sqrt(2).

A specific solution would be to include the reduced-symmetry OFF dataset in the calculation (because we use it for CCsym calculations) but to be able to assign it 0 weight in the NLL calculation. A generalization would be to allow the user to specify a list of NLL weights; one for each input MTZ.

kmdalton commented 1 year ago

@DHekstra, what you want can already be accomplished by changing the uncertainty estimates in the inputs based on the normalizing constant for the likelihood distribution. It will be challenging to implement your request at the API level as it would probably require refactoring all of the likelihood objects.

DHekstra commented 1 year ago

Yes, that's a great suggestion.