Skip to content

Remove median(::MvLogNormal)#1966

Open
devmotion wants to merge 3 commits into
masterfrom
dw/remove_median_mvlognormal
Open

Remove median(::MvLogNormal)#1966
devmotion wants to merge 3 commits into
masterfrom
dw/remove_median_mvlognormal

Conversation

@devmotion

Copy link
Copy Markdown
Member

The PR removes the definition of median(::MvLogNormal). It was added in #455 but IMO that should have been discussed more thoroughly.

  1. The marginal median is just one of multiple concepts of multivariate medians, see e.g. https://en.wikipedia.org/wiki/Median#Multivariate_median.

  2. There's no established concept of multivariate medians in Distributions as indicated by the fact that median is not defined for any other multivariate distribution (not even MvNormal).

  3. The definition of median seems to suggest that quantile etc. should be defined as well, which is not the case.

As such, I think the existence of this definition is a bug.


Alternatively, Distributions could adopt and clearly document a definition of (marginal?) medians for multivariate distributions. In this case, the fix would be to add definitions of median to other distributions such as MvNormal etc. as well.

@codecov-commenter

codecov-commenter commented Apr 11, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.65%. Comparing base (d8f3182) to head (42df8af).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1966   +/-   ##
=======================================
  Coverage   86.65%   86.65%           
=======================================
  Files         148      148           
  Lines        8919     8913    -6     
=======================================
- Hits         7729     7724    -5     
+ Misses       1190     1189    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cgarling

Copy link
Copy Markdown

Thanks for your work on maintaining this package! I think marginal medians would be useful statistics to have for all the multivariate distributions. Maybe you could differentiate the marginal median from other definitions by requiring a dims argument e.g. median(dist::MvLogNormal, dims::Integer) to specify what dimension you want the marginal median of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants