Repository navigation
nns_copula: perfect-dependence shortcut checks each pair - #165
Closed
gitRasheed wants to merge 1 commit into
Closed
gitRasheed wants to merge 1 commit into
gitRasheed wants to merge 1 commit into
Conversation
gitRasheed
force-pushed
the
rasheed/mirror-dependence
branch
from
November 2, 2026 04:12
3bace5c to
2cd45bb
Compare
gitRasheed
force-pushed
the
rasheed/mirror-moments-cdf
branch
from
November 2, 2026 04:12
a640c9c to
32224b6
Compare
… fix) The shortcut returned 1 only when the pair sum of degree-0 co-partial moments was choose(d, 2), or 0 for d = 2. That drops perfect dependence with mixed signs for d >= 3: in (x, x, -x) one pair is fully concordant and two are fully discordant, so the sum is 1 and the formula ran. As in R NNS.copula (dep-sign-and-ties), return 1 when every pair is fully concordant (1) or fully discordant (0), in copula._copula and the native copula_nd. nns_reg's default order inherits it, since it calls the copula on (x, x, y). Before -> after (= R), x = 1..100, native and fallback: nns_copula([x, x, -x]) 0.5774 -> 1 nns_copula([x, x, x, -x]) 0.2673 -> 1 _default_order(x, -x) 8 -> 10 Unchanged: the interior-pair-sum integer matrices, (x, x, x), (x, -x). New NNS.copula entries for the mixed-sign tests. The two positional NNS.boost multi-factor entries predate the R fix (the default order feeds the boost feature search) and were refilled: feature.frequency 0.2561 0.2439 -> 0.2558 0.2442.
gitRasheed
force-pushed
the
rasheed/mirror-dependence
branch
from
November 2, 2026 23:09
2cd45bb to
df1f9c5
Compare
Contributor
|
Incorporated through NNS R 14.0 integration #192, merged as |
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.
The perfect-dependence shortcut returned 1 only when the degree-0 pair sum was choose(d, 2). That misses perfect dependence with mixed signs for d >= 3: in (x, x, -x) one pair is fully concordant and two fully discordant, so the sum is 1 and the formula runs instead. We mirror the R rule, which returns 1 when every pair is fully concordant or fully discordant.
Stacked on #164; merge with a merge commit.
Changes
copula._copulaand the nativecopula_nduse the per-pair rule. For x = 1..100,nns_copula([x, x, -x])goes from 0.5774 to 1 and[x, x, x, -x]from 0.2673 to 1, in both paths.nns_reg's default order calls the copula on (x, x, y), so_default_order(x, -x)goes from 8 to 10.Interior pair sums, (x, x, x) and (x, -x) are unchanged.
Tests
New
NNS.copulaparity cases for the mixed-sign matrices. The two positionalNNS.boostmulti-factor entries predate the R fix and are refilled, because the default order feeds the boost feature search: feature.frequency moves from 0.2561 0.2439 to 0.2558 0.2442. The parity cache encodes R 13.3 plus the fixes in OVVO-Financial/NNS#73-#92.Mirrors OVVO-Financial/NNS#75
Part of OVVO-Financial/NNS#61
Review
GPT-6.1 Sol reviewed this slice and found nothing. It checked mixed-sign shortcuts against live R, including binary ties and two observations.