Skip to content

RFC: add special.erfinv to the specification #965

@kgryte

Description

@kgryte

This RFC proposes adding a new API for computing the inverse of the error function to the Array API specification in a special functions extension.

Overview

Based on array library comparison data, the API is available in a majority of array libraries in the PyData ecosystem. The inverse of the error function is particularly important in statistics (e.g., quantile of a normal distribution).

erfinv was previously discussed as a candidate for inclusion within the context of a special functions extension. That RFC addressed several topics and design discussions. This RFC seeks to cut through the noise and propose a single API candidate for inclusion in the standard.

Prior Art

Proposal

def erfinv(x: array, /) -> array

within a special functions extension in a manner similar to linalg and fft.

Comments

  • SciPy supports complex dtypes. JAX does not. As a first pass, I suggest standardizing support for real-valued floating-point arrays. In a follow-up revision, we can add support for complex dtypes.
  • As discussed in RFC: special function extension #725, there is a bikeshed regarding erfinv vs erf_inv. Personally, I side with erfinv here as this is the conventional naming convention, not only in Python, but elsewhere (e.g., Julia, MATLAB, R, etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    API extensionAdds new functions or objects to the API.RFCRequest for comments. Feature requests and proposed changes.

    Type

    No type

    Projects

    Status

    Stage 0

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions