Skip to content
New issue

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

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

Already on GitHub? # to your account

RFC: add support for complex input to mean #846

Open
lucascolley opened this issue Sep 25, 2024 · 2 comments
Open

RFC: add support for complex input to mean #846

lucascolley opened this issue Sep 25, 2024 · 2 comments
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.

# for free to join this conversation on GitHub. Already have an account? # 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

No branches or pull requests

3 participants