Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: add support for complex input to mean #846

Open
lucascolley opened this issue Sep 25, 2024 · 3 comments · May be fixed by #850
Open

RFC: add support for complex input to mean #846

lucascolley opened this issue Sep 25, 2024 · 3 comments · May be fixed by #850
Labels
API change Changes to existing functions or objects in the API. RFC Request for comments. Feature requests and proposed changes. topic: Complex Data Types Complex number data types. topic: Statistics Statistics.
Milestone

Comments

@lucascolley
Copy link
Contributor

x-ref https://github.com/data-apis/array-api-extra/pull/10/files#r1776010210

While implementing a simple cov in array-api-extra (data-apis/array-api-extra#10) I found that xp.mean does not support complex input. @kgryte suggested opening an issue over here as the arithmetic mean is well-defined for complex numbers.

@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types. topic: Statistics Statistics. labels Sep 25, 2024
@kgryte kgryte added this to the v2024 milestone Sep 25, 2024
@asmeurer
Copy link
Member

Was there a reason for this or was it just an accidental omission? Mean is well-defined for complex numbers (https://en.wikipedia.org/wiki/Complex_random_variable), and should be easy to implement since you either just apply the real kernel formula directly to complex data types, or take the means of the real and imaginary parts separately.

@kgryte
Copy link
Contributor

kgryte commented Sep 25, 2024

I believe an omission and thus far no R&D whether supported across all array libraries.

@kgryte
Copy link
Contributor

kgryte commented Oct 31, 2024

I've opened #850.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. RFC Request for comments. Feature requests and proposed changes. topic: Complex Data Types Complex number data types. topic: Statistics Statistics.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants