If there is an even number of observations, then there is no single middle value; the median is then usually defined to be the mean of the two middle values.
Note, that this will likely be a floating point value so the return type of BM_median should be changed.
If there is an even number of observations, then there is no single middle value; the median is then usually defined to be the mean of the two middle values.
Note, that this will likely be a floating point value so the return type of BM_median should be changed.