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

Initialisation model and improved unit testing for distributions #74

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

SamuelBrand1
Copy link
Collaborator

Main change

This PR makes a simple initialize_incidence Turing model constructor available, but doesn't implement using it. This is because we are likely to refactor the API from this point.

Minor change

Unit tests on distributional usage were relying on direct analytic solutions; to speed this up I've added HypothesisTests as a dependency to the test environment (not the package environment).

Usage

  • For expected continuous distributions, random variables sampled from EpiAware functions are compared against the expected distribution using a Kolmogorov-Smirnov test HypothesisTests.ExactOneSampleKSTest e.g here.
  • For expected discrete distributions, random variables sampled from EpiAware functions are compared against the expected distribution by also generating samples from the expected distribution and comparing two sample averages using one way ANOVA HypothesisTests.OneWayANOVATest, and variance using a F test HypothesisTests.VarianceFTest. Implementation example here.

For hypothesis tests the test fails at p < 1e-6, e.g. if there is a correctly implemented test the failure chance is one-in-a-million. Typically, this means that sampling from the model should be in order of a few thousand to avoid potential false passes.

@SamuelBrand1 SamuelBrand1 linked an issue Feb 26, 2024 that may be closed by this pull request
Copy link
Collaborator

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

This looks good to me. Really nice.

@seabbs seabbs merged commit e68f868 into main Feb 26, 2024
5 checks passed
@seabbs seabbs deleted the 64-abstraction-for-init-value branch February 26, 2024 15:52
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.

Abstraction for init value
2 participants