Repository navigation
BUG: Preserve small normal-tail p-values - #977
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #977 +/- ##
=======================================
Coverage 98.95% 98.95%
=======================================
Files 137 138 +1
Lines 30104 30141 +37
Branches 2337 2339 +2
=======================================
+ Hits 29790 29827 +37
Misses 256 256
Partials 58 58
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Thanks. |
jngod2011
pushed a commit
to jngod2011/arch
that referenced
this pull request
Oct 31, 2026
- Highlights and new features: NGARCH (bashtage#966), the VaR backtests (bashtage#965), the local block bootstrap (bashtage#967) and bandwidth_method (bashtage#964, and phillips_ouliaris here). - Changes that alter results: the automatic bandwidth entry of bashtage#983 now also describes the bandwidth of the kernels with bounded support, the fractional bandwidths and the Tukey-Parzen constant of bashtage#964, its S&P 500 bandwidths are those of the bandwidth attribute (30.96 and 34.50, where it said the 31.96 and 35.50 of opt_bandwidth), and it links phillips_ouliaris in arch.unitroot.cointegration. The ADF-Z tables of bashtage#972, bashtage#973 and bashtage#980. - Backward-incompatible changes: strings in object data. - Bug fixes: bashtage#954, bashtage#970, bashtage#974, bashtage#975, bashtage#977, bashtage#978, bashtage#982, and the constant data of the Newey-West bandwidth and mackinnonp at -inf and inf. - Maintenance: the CI changes and the version file. - Contributors: galafis, jackiectl2, mkzung and wavebyrd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cointegration coefficient p-values, DynamicOLSResults.summary(full=True) and VarianceRatio calculate two-sided normal tails by subtracting a CDF from one. This loses relative accuracy and rounds representable probabilities to zero. A standard-normal statistic of 10 should give a two-sided p-value near 1.524e-23.
Use 2*norm.sf(abs(statistic)) in all three paths. This follows the merged #975 and the maintainer's invitation to replace the remaining 1-cdf calculations: #975 (comment) .
The regressions compare against independent math.erfc(abs(stat)/sqrt(2)) with zero absolute tolerance. They cover positive/negative tails, exact zero and ordinary values. The full-summary regression exposes unrounded values through a test-only display formatter. Before the fix, 14 cases fail and 8 controls pass; afterward, all 22 pass.
On fresh main 2646f9a, the relevant source, existing tests/fixtures and contribution policy are identical to the previously validated head 806d630; the only upstream changes are two unrelated bootstrap comparison files. Repeated the 22 focused cases, Ruff lint/format and git diff --check on this new base: all pass. Earlier validation of the same normal-tail code passed 3679 tests in DynamicOLS/FMOLS/CCR/new regressions/utilities, plus 86 existing VarianceRatio tests (406 unrelated cases deselected); the 22 focused cases are included in the 3679.
Windows/Python 3.12.14, NumPy 2.5.4, pandas 3.1.0, SciPy 1.18.1 and statsmodels 0.15.0. Tests import the current source; the arch 8.0.0 wheel supplies only ignored version metadata. The full arch suite and compiled/multi-version matrices were not run.