Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 1293 by [email protected]: Implemented s.s.d.Sample.median http://code.google.com/p/sympy/issues/detail?id=1293
I implemented sympy.statistics.distributions.Sample.median, which previously raised NotImplementedError. Tests are included. There are two things worth noting here: 1) Samples are now automatically sorted when created. It is needed to sort the sample if one wants to calculate the median, and I thought it would not hurt to store the sorted version instead of the original one. At least it seems not to break any tests. 2) Wikipedia says[1]: "If there is an even number of observations, the median is not unique, so one often takes the mean of the two middle values." This is how I did it. The alternatives I can think of are a) just use one of the middle values or b) raise an exception. What do you think? [1] http://en.wikipedia.org/wiki/Median Also, would you please update my email address in the AUTHORS file (patch included)? Thanks! -- Felix Kaiser Attachments: 0001-Implemented-s.s.d.Sample.median.patch 2.0 KB 0001-Updated-Felix-Kaiser-s-email-address.patch 758 bytes -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en -~----------~----~----~----~------~----~------~--~---
