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

ECORR incorrectly only applied when if slc.stop - slc.start > 1 in an epoch #355

Open
vhaasteren opened this issue Sep 22, 2023 · 0 comments

Comments

@vhaasteren
Copy link
Member

In ShermanMorrison (and BlockMatrix?), the ECORR signal is only applied to epochs where there is more than 1 observation. Although the reasoning seems to make sense that this would otherwise just be an EQUAD at that epoch, this is not a correct way to restrict application. The ECORR signal in our generative model affects an observation whether or not there are more observations in that epoch. It always affects the observation, whether or not it is distinguishable from an EQUAD or not.

So, for instance, in the below code we should change the if condition to > 0, so allow for single observations.

    def _get_logdet(self):
        """Returns log determinant of :math:`N+UJU^{T}` where :math:`U`
        is a quantization matrix.
        """
        logdet = np.einsum("i->", np.log(self._nvec))
        for slc, jv in zip(self._slices, self._jvec):
            if slc.stop - slc.start > 1:
                niblock = 1 / self._nvec[slc]
                beta = 1.0 / (np.einsum("i->", niblock) + 1.0 / jv)
                logdet += np.log(jv) - np.log(beta)
        return logdet

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

No branches or pull requests

2 participants