MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / median

Method median

JSAT/src/jsat/linear/DenseVector.java:177–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175 }
176
177 @Override
178 public double median()
179 {
180 double[] copy = Arrays.copyOfRange(array, startIndex, endIndex);
181
182 Arrays.sort(copy);
183
184 if(copy.length % 2 == 1)
185 return copy[copy.length/2];
186 else
187 return copy[copy.length/2]/2+copy[copy.length/2+1]/2;//Divisions by 2 then add is more numericaly stable
188 }
189
190 @Override
191 public double skewness()

Callers

nothing calls this directly

Calls 1

sortMethod · 0.45

Tested by

no test coverage detected