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

Add test case for Loopy ARG #304

Open
hyanwong opened this issue Jul 24, 2023 · 1 comment
Open

Add test case for Loopy ARG #304

hyanwong opened this issue Jul 24, 2023 · 1 comment

Comments

@hyanwong
Copy link
Member

We have the simplest possible loopy graph in

def loopy_tree():

We should use this in the test_accuracy.py file somehow, to check that iteration in the Expectation Propagation algorithm correctly accounts for the probabilities passed around the graph. I think there should be a semi-principled way of thing this (akin to checking the total functional value around the tree, e.g. in

class TestTotalFunctionalValueTree:
). Can you think of any way to test this @nspope: i.e. that's not a test of the accuracy of time inference, but of the end point of the iteration? E.g. in the simplest case, can we find a predicted set of values we should be converging on?

@nspope
Copy link
Contributor

nspope commented Jul 24, 2023

Hmm, some general thoughts:

  • The only case where we can compute the posterior exactly is a three tip tree (two free nodes); but in this case the tests reduce to the "TestPosteriorMomentMatching" class.
  • Because of the time-ordered traversal, EP for a single tree should converge in a single iteration; we don't test this currently
  • If we add a lot of mutations to a single tree, then the EP estimates should get consistent rather quickly; e.g. the posterior should concentrate around the true mean. This would be good to test (also for numerical problems).
  • We can test that the approximations converge to something -- the gamma parameters stabilizing after a few iterations. We can just measure the norm of the difference in sufficient statistics between two consecutive iterations or something similar.

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

No branches or pull requests

2 participants