Computation of median for discrete data: non-standard computation
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- data
Research direction
Start by reading the math library's median implementation and its documentation, then run the reported example with (list 1 2 3 4). Check how quantile handles even-length discrete data as well. Done means the documented median behavior is consistent with the intended convention, with coverage for the even-length case.
Written by the indexing model from the issue text.
Description
Using (require math), we can compute (median < data), where data is a list of numbers.
When data length is even, then normally the median is computed by averaging the two central elements, after ordering.
The problem is that running the following code we obtain 2, but considering tipical references (e.g. wikipedia median) the value should be 2.5:
#lang racket
(require math)
(define data (list 1 2 3 4))
(median < data)
Could we maybe add some parameterization to the function median (and may be also to quantile) in order to compute the average of the central two elements, when the number of elements is even?
Thank you and congratulations for all your great work.
- Dominant language
- Racket
- Stars
- 40
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from racket/math
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Wishlist: flzero? Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
bug needs triage p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 comment ·
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 72/100
acl-org/acl-anthology#10025 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Schema-level dtype cannot be serialized: to_yaml raises RepresenterError, to_json raises TypeError Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
unionai-oss/pandera#2511 ·