Skip to content

Conversation

@danielfong-act
Copy link
Contributor

After adjusting the incrementals by their exposure in plot_ptf_resid.py, the resultant graphs match those of Barnett and Zehnwirth's paper (p. 281 of this paper). Exposures are given on the previous page. Also, the origin graph needed its axis limits tweaked. For reasons unknown, the data was stretched to the edges of the plot.

Thanks to @henrydingliu for noting that you don't need to construct a triangle to do triangle arithmetic; a numpy array works fine.

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.44%. Comparing base (d4b2c42) to head (22336f9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #638   +/-   ##
=======================================
  Coverage   84.44%   84.44%           
=======================================
  Files          84       84           
  Lines        4823     4823           
  Branches      610      610           
=======================================
  Hits         4073     4073           
  Misses        538      538           
  Partials      212      212           
Flag Coverage Δ
unittests 84.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henrydingliu
Copy link
Collaborator

@danielfong-act thanks for pulling this together. small nitpick, the previous figure numbering of 3.11 doesn't match the numbering of the current version of the paper.

@danielfong-act
Copy link
Contributor Author

I swore I fixed that

@henrydingliu
Copy link
Collaborator

do we need to wait for a fix to #639 ?

@danielfong-act
Copy link
Contributor Author

Nah it's fine. The missing standard residual(s) would be the last, rightmost point on the origin and development graphs. It's an intermittent bug, so I'll update #639 to reflect that.
I did encounter the bug when I was toying with this notebook, but I can't remember how to replicate it.

Copy link
Collaborator

@henrydingliu henrydingliu left a comment

Choose a reason for hiding this comment

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

exposure adjustment appears correct.

@henrydingliu henrydingliu merged commit 91b0ebd into casact:master Jan 5, 2026
11 checks passed
henrydingliu added a commit that referenced this pull request Jan 5, 2026
* Fix for #634 (#638)

squashed commits as some the earlier commit were later reversed

* Added exposure adjustment to barnzehn.py. Updated ptf example gallary with exposure adjustments to match paper.

* fixed bug when not passing sample_weight to BarnettZehnwirth.fit. updated plot_ptf_resid in gallery.

* removed sample_weight from barnettzehnwirth.fit

* unremoved sample_weight from barnettzehnwirth.fit -- the estimator ignores it as it did originall

* fixed graph title

---------

Co-authored-by: danielfong-act <danielfong247@gmial.com>

* adding another test for bz

---------

Co-authored-by: danielfong-act <danielfong247@gmail.com>
Co-authored-by: danielfong-act <danielfong247@gmial.com>
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