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

change default LatentDelay constructor to right truncation at 99th perc #265

Merged
merged 2 commits into from
Jun 9, 2024

Conversation

SamuelBrand1
Copy link
Collaborator

@SamuelBrand1 SamuelBrand1 commented Jun 8, 2024

I spotted that the default behaviour of the usual LatentDelay constructor was to have right truncation at 15 time steps irrespective of the underlying delay distribution. This is obviously a potential source of making silent errors.

This PR changes the constructor so that default of behaviour of this constructor is to calculate the 99th percentile of the observation distribution i.e.

$$x_{99} = F^{(-1)}(0.99).$$

Where $F^{(-1)}$ is the inverse of the distribution function of the delay1. And use the rounded value of $x_{99}$ as the right truncation value for the constructor.

Footnotes

  1. NB: the constructor is only defined for continuous delay distributions so this is always valid.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.34%. Comparing base (e73fd9e) to head (74c818a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #265      +/-   ##
==========================================
+ Coverage   93.31%   93.34%   +0.02%     
==========================================
  Files          45       45              
  Lines         449      451       +2     
==========================================
+ Hits          419      421       +2     
  Misses         30       30              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Nice. LGTM

@seabbs seabbs merged commit 4688d20 into main Jun 9, 2024
10 checks passed
@seabbs seabbs deleted the fix-latent-delay-default branch June 9, 2024 20:26
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.

3 participants