Gaussian Error Functions, Normal Probabilities, and Inverse CDFs
Summary
This Pine library provides approximations for the error function and its complement, their inverse functions, and related normal-distribution calculations. It exposes cumulative and complementary cumulative probabilities, inverse cumulative transforms that map an area back to a z-score, interval probabilities, and one- and two-tailed probability calculations. These functions support statistical work such as translating standardized values into tail areas or recovering a standardized threshold from a probability.
The library offers faster lower-precision approximations alongside implementations aimed at double-precision accuracy, drawing on established numerical methods and standard math-library routines. The stated precision varies by method, and extreme inputs require care because floating-point limits and boundary handling affect results. The document describes reusable numerical utilities rather than a trading strategy or a market test; it provides no evidence that applying the functions directly creates predictive signals. Quant researchers should validate edge cases and precision requirements for their use case.
Key ideas
- The library estimates Gaussian areas through error and complementary error functions.
- It includes inverse functions for mapping probabilities back to standardized thresholds.
- Cumulative probabilities can be computed over intervals and for one- or two-sided tests.
- Fast approximations trade some precision for lower computational cost.
- Accuracy and boundary behavior depend on the chosen method and numerical range.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.