I redid the French Wilson scaling implementation. Notable differences from the previous version:
All posteriors are estimated by Gauss-Legendre quadrature
Structure factor means and standard deviations are estimated by quadrature. They were treated analytically before.
Both centric and acentric posteriors are refactored into a single function _french_wilson_posterior_quad
I'm using scipy.stats distributions to compute log probabilities
I'm doing all calculations in log space using the scipy logsumexp function to compute summations
This PR fixes two important bugs
Structure factor posteriors were not computed correctly in the past. You cannot just take the square root of the posterior intensities. Instead we compute expectations for the moments.
Previous versions didn't compute the mean intensity, Sigma correctly. Intensities should be corrected for their multiplicities before estimating Sigma. The resulting Sigma values should be re-inflated after by multiplying by the multiplicity.
I redid the French Wilson scaling implementation. Notable differences from the previous version:
_french_wilson_posterior_quad
This PR fixes two important bugs
Sigma
correctly. Intensities should be corrected for their multiplicities before estimatingSigma
. The resultingSigma
values should be re-inflated after by multiplying by the multiplicity.