Skip to content

Fix lillietest MCTol p-value formula. - #468

Merged
pr0m1th3as merged 1 commit into
gnu-octave:mainfrom
AvanishSalunke:lillietest
Sep 8, 2026
Merged

Fix lillietest MCTol p-value formula.#468
pr0m1th3as merged 1 commit into
gnu-octave:mainfrom
AvanishSalunke:lillietest

Conversation

@AvanishSalunke

Copy link
Copy Markdown
Contributor

lillietest's Monte-Carlo p-value used a smoothing formula that could never return an exact 0.
BEFORE:

octave:3> x = [zeros(1,15), 100];
octave:4> [h, p, kstat] = lillietest(x, 'MCTol', 0.05);
octave:5> p
p = 9.9900e-04

AFTER:

octave:4> x = [zeros(1,15), 100];
octave:5> [h, p, kstat] = lillietest(x, 'MCTol', 0.05);
octave:6> p
p = 0

MATLAB:

>> x = [zeros(1,15), 100];
>> [h, p, kstat] = lillietest(x, 'MCTol', 0.05);
>> p

p =

     0

@pr0m1th3as
pr0m1th3as merged commit 793aed2 into gnu-octave:main Sep 8, 2026
pr0m1th3as added a commit that referenced this pull request Sep 8, 2026
  jbtest with MCTol returns the unsmoothed proportion, so p reaches exactly 0
  and exactly 1.  The added one made 1 / (reps + 1) the smallest value it
  could report.  lillietest was corrected in 793aed2.
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