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

Fix incorrect signed noise terms for DiscreteAdditiveNoiseModel #1260

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

GregVS
Copy link
Contributor

@GregVS GregVS commented Oct 7, 2024

Hello,
I believe the noise terms for the DiscreteAdditiveNoiseModel are being computed with the wrong sign. The noise terms are added to the predicted value, therefore they should be computed by subtracting the predicted value from the true value. Currently, they are computed the other way, which would lead the noise distribution to be incorrect. They are computed correctly in the PostlinearNoiseModel implementation; I've updated the DiscreteAdditiveNoiseModel to function the same.

@bloebp
Copy link
Member

bloebp commented Oct 7, 2024

Thanks a lot! Do you mind adding a unit test as well that tests this explicitly?

@GregVS
Copy link
Contributor Author

GregVS commented Oct 9, 2024

Yes, will do when I get a chance!

@bloebp
Copy link
Member

bloebp commented Oct 18, 2024

Hey, any chance to prepare a small test?

Copy link
Member

@bloebp bloebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is definitely correct, lets add a test as a follow-up to unblock the merge.

@bloebp bloebp merged commit b17f2c3 into py-why:main Oct 22, 2024
1 check passed
@bloebp
Copy link
Member

bloebp commented Oct 22, 2024

@all-contributors please add @GregVS for code

Copy link
Contributor

@bloebp

I've put up a pull request to add @GregVS! 🎉

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

Successfully merging this pull request may close these issues.

2 participants