meta
numerics

Meta.Numerics library features include complex numbers, special functions, data analysis and statistical tests, and matrix operations.

Complex and Other Numbers

The library defines several specialized mathematical objects:

  • Complex numbers
  • Uncertain numbers
  • Spinors

For each type, appropriate arithmetic operations are defined and an associated static class implements appropriate basic functions.

Advanced Functions

The library defines a large number of advanced mathematical function on real numbers, Complex numbers, and integers. The real and complex advanced functions are summarized in the following table.

Function Real Complex Notes
Gamma yes yes also ln Γ, incomplete Γ
Psi (Digamma) yes yes  
Beta yes   also incomplete B
Error Function erf yes yes also erfc, erf-1, Faddeeva
Fresnel Integrals yes    
Exponential and Trigonometric Integrals yes   includes En, Ei, Ci, and Si
Bessel J and Y yes   also for non-integer orders, spherical Bessel j and y
Modified Bessel I and K yes   also for non-integer orders, , Airy Ai and Bi
Coulomb Wave Functions F and G yes   accurate even in quantum tunneling region
Reimann Zeta yes yes also Dirichlet η
Dilogarithm Li2 (Spence's Function) yes yes  
Hermite H yes   physicists' and statisticans' normalization
Laguerre L yes    
Legendre P yes    
Chebyshev T yes    
Zernike R yes    

Functions of integers include Factorials, Binomial coefficients, greatest common denominators (GCD) and least common multiples (LCM).

Spinor functions, including 3j symbols (Clebsch-Gordon coefficients) and 6j symbols.

Function Properties

Library routines support root finding, maximum and minimum finding, and the integration of arbitrary user-supplied functions.

Statistics and Data Analysis

The library provides specialized classes for working with various types of data, including:

  • Univariate Samples
  • Multivariate Samples
  • Experimental Data with Error Bars
  • Contingency Tables

For each kind of data, methods allow you to evaluate descriptive statistics, fit models, and perform appropriate statisical tests. All fits produce not just a best-fit parameter set, but also error bars, a covariance matrix, and a goodness-of-fit test.

Some of the many statistical tests supported by the library are listed below:

Test Name Test Purpose
Student t for equal means
Mann-Whitney U for equal medians
Fisher F for equal variances
Kolmogorov-Smirnov D, Kuiper V for fit to a distribution
χ2 for fit to a function
Pearson r for linear correlation
Spearman ρ, Kendall τ for non-linear correlation
χ2, Kendall exact for categorical correlation

The statistics library defines a large number of probability distributions:

Chi Squared Exponential Fisher Kolmogorov
Kuiper Logistic Lognormal Normal
Student Triangular Uniform Weibull

For all defined distributions, you can obtain:

  • Basic Descriptive Statistics: mean, median, variance, standard Deviation
  • Probability Density Function (PDF) values
  • Cumulative Distribution Function (CDF) values, integrated from the left or right
  • Inverse CDF values, i.e. percentile to score conversion
  • Arbitrary raw and central moments

Matrix Algebra

The library defines a number of matrix classes and operations on them. The following table summarizes the available matrix operations.

Operation Generic Square Symmetric Tridiagonal
Arithmetic yes yes yes yes
Decomposition   yes yes yes
Determinant   yes yes yes
Inverse   yes yes yes
Eigenvalues and Eigenvectors   yes yes yes

Testing

The library has undergone extensive testing. We test more than 600 mathematical relationships, most for scores of different arguments ranging over many orders of magnitude. If there is a relationship in Abromiwitz and Stegun expressible using our library functions, we have probably tested it. Our test cases achieve code coverage in excess of 80%.