Returns the median value in this vector @return the median
()
| 548 | * @return the median |
| 549 | */ |
| 550 | public double median() |
| 551 | { |
| 552 | Vec copy = sortedCopy(); |
| 553 | if(copy.length() % 2 != 0) |
| 554 | return copy.get(copy.length()/2); |
| 555 | else |
| 556 | return copy.get(copy.length()/2)/2+copy.get(copy.length()/2+1)/2; |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * Computes the skewness of this vector, which is the 3rd moment. |