I can't reproduce by hand Mathematica's
PearsonChiSquareTest[dataset1,dataset2] on two datasets of discrete rand variables,
N1 much less than
N2. (I just want to understand what it's doing).
I assume Mathematica determines
B bins (using
B=Ceiling[2*N1^0.4] - note the
N1.), applies this to
dataset2, and uses these to bin the datasets. The chisqr (as per NumC recipes and elsewhere) is not the sum over $i$ of:
where $u$ and $v$ are the bin frequencies for the 2 datasets, and
Using this I get chisqr's scattered near, but below what
Btw, bin delimiters are from
HypothesisTestData property doesn't contain enough info to really see what's going on. Maybe Mathematica chooses bins differently? or uses a correction to the formula above?
Thanks for any insights.