Skip to content

nns_anova: pooled grand mean and median, median robust estimate (book ch15) - #175

Closed
gitRasheed wants to merge 1 commit into
rasheed/book-optim-pifrom
rasheed/book-anova-grand-mean
Closed

gitRasheed wants to merge 1 commit into
rasheed/book-optim-pifrom
rasheed/book-anova-grand-mean

Conversation

@gitRasheed

Copy link
Copy Markdown
Collaborator

Multi-group nns_anova took the grand statistic as the unweighted mean of the group means or medians, so group sizes did not count, while book ch15 pools the observations (ch15:532-536) and uses the combined median (ch15:593). The two-sample medians path took a size-weighted mean of the two medians, and the robust estimate was NNS.gravity of the bootstrap certainties where ch15:617 says median or mean. We mirror OVVO-Financial/NNS#89, which makes R follow the book, including its NaN-skipping robust median. That PR changes the method, so the R author may close it; if so, this slice should be dropped too.

Stacked on #174; merge with a merge commit.

Changes

  • Multi-group: the grand mean or median is taken over all observations pooled. Three Exp groups of sizes 12, 60 and 25 go from Certainty 0.1274 to 0.1403, and from 0.1702 to 0.1677 with medians=True.
  • Two-sample with medians=True: the grand median is the median of both samples pooled. Exp(1) n = 40 against Exp(1.4) n = 90 goes from Grand_Statistic 0.9764 to 0.9644. The mean path was already size-weighted.
  • robust=True reports the median of the finite bootstrap certainties. The same pair with seed 3 goes from 0.7005 to 0.6861. This also removes a property-test case where the robust estimate sat above its upper interval bound.

Tests

23 NNS.ANOVA.custom entries for the medians and robust cases predate the R change and are refilled; the other 25 came back identical. Two entries are added for the new multi-group test. The parity cache encodes R 13.3 plus the fixes in OVVO-Financial/NNS#73-#92.

Mirrors OVVO-Financial/NNS#89

Review

GPT-6.1 Sol reviewed this slice and found nothing. It compared unequal groups, pooled medians, ties and seeded robust estimates against R.

…-grand-mean-medians)

Mirrors R's anova-grand-mean-medians branch (NNS.ANOVA), including the
NaN-skipping robust median.
- Multi-group: the grand statistic was the unweighted mean of the group
  means (or medians). It is now the mean (or median) of all observations
  pooled, so group sizes count.
- Two-sample with medians=True: the grand median was the size-weighted
  mean of the two medians; it is now the median of both samples pooled.
  The mean path was already size-weighted and is unchanged.
- robust=True reports the median of the finite bootstrap certainties
  instead of NNS.gravity of them.

Before -> after (= R):
  three Exp groups, n = 12/60/25, Certainty        0.1274 -> 0.1403
    medians=True                                    0.1702 -> 0.1677
  two-sample Exp(1) n=40 vs Exp(1.4) n=90, medians=True, Grand_Statistic
                                                    0.9764 -> 0.9644
  same pair, robust=True, seed 3, Robust Certainty Estimate
                                                    0.7005 -> 0.6861

23 NNS.ANOVA.custom entries (the medians and robust cases) predate the R
change and were refilled; the other 25 came back identical. Two entries
are added for the new multi-group test.
@gitRasheed
gitRasheed force-pushed the rasheed/book-optim-pi branch from 65ce1ee to a48cdc3 Compare November 2, 2026 23:09
@gitRasheed
gitRasheed force-pushed the rasheed/book-anova-grand-mean branch from 2035b9d to 6107835 Compare November 2, 2026 23:09
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Incorporated through NNS R 14.0 integration #192, merged as bd19c3303222af46da79d8c97f258248eb5674d2. Verified exact head 6107835d064c7a3280cffa48a77a7dafe17aeff3 is an ancestor of main; original commits and authorship are preserved. The integration includes the subsequent R14 compatibility corrections and passed the complete GitHub Python 3.11-3.14 matrix. This supersedes the separate landing, not the work or review history.

@github-actions github-actions Bot closed this Nov 7, 2026
@github-actions
github-actions Bot deleted the rasheed/book-anova-grand-mean branch November 7, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant