Skip to content

accept a zero ThresholdFactor in isoutlier - #536

Merged
pr0m1th3as merged 1 commit into
gnu-octave:mainfrom
AvanishSalunke:isoutlier
Oct 31, 2026
Merged

pr0m1th3as merged 1 commit into
gnu-octave:mainfrom
AvanishSalunke:isoutlier

Conversation

@AvanishSalunke

Copy link
Copy Markdown
Contributor

ThresholdFactor is documented as a nonnegative scalar, but the input check used <= 0, so a value of 0 was rejected.

BEFORE:

octave:2> A = [57 59 60 100 59 58 57 58 300 61 62 60 62 58 57];
octave:3> [TF, L, U, C] = isoutlier (A, 'ThresholdFactor', 0)
error: isoutlier: threshold factor must be a nonnegative scalar.
error: called from
    isoutlier at line 298 column 13

AFTER:

octave:2> A = [57 59 60 100 59 58 57 58 300 61 62 60 62 58 57];
octave:3> [TF, L, U, C] = isoutlier (A, 'ThresholdFactor', 0)
TF =

  1  0  1  1  0  1  1  1  1  1  1  1  1  1  1

L = 59
U = 59
C = 59

MATLAB:

>> A = [57 59 60 100 59 58 57 58 300 61 62 60 62 58 57];

>> [TF, L, U, C] = isoutlier (A, 'ThresholdFactor', 0)


TF = 1×15 logical array
     1     0     1     1     0     1     1     1     1     1     1     1     1     1     1


L =

    59


U =

    59


C =

    59

@pr0m1th3as
pr0m1th3as merged commit 3881daa into gnu-octave:main Oct 31, 2026
8 checks passed
pr0m1th3as added a commit that referenced this pull request Oct 31, 2026
Follow-up to #536.  An integer or single factor now gives double
thresholds, as in MATLAB, where an integer one gave rounded values.

* inst/Data_Manipulation/isoutlier.m: check the type of
  'ThresholdFactor' and cast it to double; state the zero and tiny
  factor results for 'grubbs' and 'gesd'; add tests.
* inst/Data_Manipulation/doc-cache: refresh isoutlier.
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