gnu-octave / statistics

The Statistics package for GNU Octave
GNU General Public License v3.0
24 stars 22 forks source link

mad.m: correct mad handling of vectors with multiple Infs #135

Closed NRJank closed 5 months ago

NRJank commented 5 months ago

*inst/shadow9/mad.m: Fix condition for replacing output with Inf when using median. Unlike with mean, instead of condition being when number of Infs is > 0, it should be when it is >numel(x)/2. The Inf only affects the output when the sorted middle value is Inf. (also working up fix for similar issue in core so outputs should be compatible.)