Skip to content

fix(p2): update markers for extreme observations - #42

Merged
asiffer merged 3 commits into
asiffer:masterfrom
shenxiangzhuang:fix/p2-extrema-marker-positions
Sep 6, 2026
Merged

asiffer merged 3 commits into
asiffer:masterfrom
shenxiangzhuang:fix/p2-extrema-marker-positions

Conversation

@shenxiangzhuang

@shenxiangzhuang shenxiangzhuang commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • select the appropriate P² cell when an observation becomes a new minimum or maximum
  • update actual and desired marker positions for every observation
  • adjust interior markers after extreme observations as required by the P² algorithm
  • add deterministic ascending and descending regression coverage
  • keep randomized approximation checks focused on aggregate error rather than individual order-sensitive outliers
  • bump the release version to 3.1.0

Fixes #41.

Tests

  • strict C99 compilation of src/p2.c with -Wall -Wextra -Werror -pedantic
  • make test on Ubuntu
  • direct test/bin/p2_test execution on Ubuntu: 4 tests, 0 failures

For the 100 seeds and 20 probabilities covered by p2_test, the mean uniform error changes from 0.001191 to 0.000657, and the mean Gaussian relative error changes from 0.006559 to 0.007278. Both remain within the existing 0.01 aggregate bound. Individual errors above the diagnostic thresholds continue to be reported by the test.

@asiffer

asiffer commented Sep 4, 2026

Copy link
Copy Markdown
Owner

I think you need to bump the version to pass the test (3.1.0). I don't think we have to change the CI (#43).

@shenxiangzhuang

Copy link
Copy Markdown
Contributor Author

OK, that makes sense. I suggested changing the CI because the dry run depends on the package version being unpublished, which could affect later PRs. However, since the actual staging step is already restricted to tags, I’m happy to follow your release workflow. I’ll bump the version to 3.1.0, close #43, and update the current PR accordingly.

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.

P² marker positions are not updated when a sample becomes a new extremum

2 participants