math-php

Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra

MIT License

Downloads
4.5M
Stars
2.3K
Committers
18
math-php - v2.10.0 Latest Release

Published by markrogoyski 6 months ago

New Features

  • NumberTheory\Integer isPrime
math-php - v2.9.0

Published by markrogoyski 8 months ago

New Features

  • Distance chebyshev

Improvements

  • Internal build CI/CD improvements
math-php - v2.8.1

Published by markrogoyski over 1 year ago

Improvements

  • Internal improvements to improve conformance with static analysis tools
math-php - v2.8.0

Published by markrogoyski over 1 year ago

New Features

  • Matrix rowAddVector
  • Matrix columnAddVector

Improvements

  • Better error handling and exception message in Sequence\NonIntenger::hyperharmonic
  • Internal code improvements to conform to static analysis checks

Backwards Incompatible Changes

  • Helper method names changed (public abstract methods but not part of published interface)
    • NumericalDifferentiation::isTargetInPoints changed to assertTargetInPoints
    • NumericalDifferentiation::isSpacingConstant changed to assertSpacingConstant
math-php - v2.7.0

Published by markrogoyski almost 2 years ago

Improvements

  • Improved algorithm for regularizedIncompleteBeta: Addresses issue 458
  • Issue 456: Improved PHPDoc blocks: Changed "number" to "int|float"
  • Added PHP 8.2 for CI test target
math-php - v2.6.0

Published by markrogoyski over 2 years ago

v2.6.0 - 2022-04-10

Improvements

  • Average::truncatedMean behavior at 50% trim made consistent
  • PHP 8.1 compatibility improvements

Backwards Incompatible Changes

  • Average::truncatedMean throws exception if trim percent greater than 50% rather than error or unpredictable results.
math-php - v2.5.0

Published by markrogoyski almost 3 years ago

New Features

  • Special function logbeta
  • Special function logGamma
  • Special function logGammaCorr
  • Special function stirlingError

Improvements

  • Improvements in StudentT continuous distribution
  • Improvements in special function gamma
  • Improvements in special function beta

Bug Fixes

  • Issue 393 (regularizedIncompleteBeta NAN)
  • Issue 429 (Linear regression CI division by zero)
math-php - v2.4.0

Published by markrogoyski over 3 years ago

New Features

  • Complex Exponential (exp)
  • Complex Exponentiation (pow)
  • Zipf's Law Discrete Distribution
  • Generalized harmonic non-integer sequence

Improvements

  • Fixed Complex polarForm to compute the right values
  • Fixed hyperharnomic non-integer sequence. Previously was computing the wrong thing
  • Fixed how ArbitraryInterger handles pow of negative exponents

Backwards Incompatible Changes

  • Complex polarForm now returns an array rather than a Complex number, as the Complex return was incorrect
  • Interface to hyperharmonic non-integer sequence changed due to previous implementation being incorrect
math-php - v2.3.0

Published by markrogoyski over 3 years ago

New Features

  • Matrix SVD (Singular Value Decomposition)
  • Polynomial companion matrix
math-php - v2.2.0

Published by markrogoyski over 3 years ago

New Features

  • PLS (Partial Least Squares Regression)

Improvements

  • Add custom __debugInfo to NumericMatrix
math-php - v2.1.0

Published by markrogoyski over 3 years ago

New Features

  • Quaternion
math-php - v2.0.0

Published by markrogoyski over 3 years ago

New Features

  • Matrix Improvements
    • walk method to map a function to all values without mutation or returning a value
    • MatrixFactory creates more matrix types
    • MatrixFactory::createNumeric to create NumericMatrix types
    • MatrixFactory::createFromRowVector
    • MatrixFactory::createFromColumnVector
    • Internal ObjectMatrix improvements
      • Add trace
      • Add scalarMultiply
    • Add initial ComplexMatrix
  • Sample data People

Improvements

  • Bug fixes
    • Issue 414 fixed - PCA/Eigenvalue convergence
    • Issue 413 fixed - matrix solve with singular matrix using RREF

Migration - Upgrading to v2.0 from v1.0

  • PHP minimum version now 7.2 (was 7.0)
  • Deprecated code removed (backwards-incompatible change)
    • MathPHP\Statistics\Distance::kullbackLeiblerDivergence removed (Use MathPHP\Statistics\Divergence::kullbackLeibler instead)
    • MathPHP\Statistics\Distance::jensenShannonDivergence removed (Use MathPHP\Statistics\Divergence::jensenShannon instead)
    • Matrix Decompositions no longer implement \ArrayAccess interface to access decomposition matrixes. Use properties instead.
      • MathPHP\LinearAlgebra\Decomposition\Cholesky
        • $cholesky['L'], $cholesky['Lᵀ'], $cholesky['LT'] removed, use $cholesky->L, $cholesky->Lᵀ, $cholesky->LT instead.
      • MathPHP\LinearAlgebra\Decomposition\Crout
        • $crout['L'], $crout['U'] removed, use $crout->L, $crout->U instead.
      • MathPHP\LinearAlgebra\Decomposition\LU
        • $LU['L'], LU['U'], LU['P'] removed, use $LU->L, $LU->U, $LU->P instead.
      • MathPHP\LinearAlgebra\Decomposition\QR
        • $QR['Q'], $QR['R'] removed, use $QR->Q, $QR->R instead.
  • Methods renamed (backwards-incompatible change)
    • MathPHP\Statistics\Distance::bhattacharyyaDistance renamed to MathPHP\Statistics\Distance::bhattacharyya
    • MathPHP\Statistics\Distance::hellingerDistance renamed to MathPHP\Statistics\Distance::hellinger
  • Moved Functionality (backwards-incompatible change)
    • MathPHP\Functions\Polynomial moved to MathPHP\Expression\Polynomial
    • MathPHP\Functions\Piecewise moved to MathPHP\Expression\Piecewise
  • Matrix internal refactoring
    • Note: These changes will not affect any client code as long as matrices were created using MatrixFactory.
    • Matrix is not a base abstract class for all matrix classes to extend
    • Matrix renamed NumericMatrix
    • Matrix base method createZeroValue
      • Use case is various ObjectMatrix classes that implement ObjectArithmetic
    • RowVector removed. Use MatrixFactory::createFromRowVector instead
    • ColumnVector removed. Use MatrixFactory::createFromColumnVector instead
math-php - v1.11.0

Published by markrogoyski over 3 years ago

Improvements

  • Bugfix (Issue 413): Matrix solve with singular matrix using RREF
  • Bugfix (Issue 414): PCA/Eigenvalue convergence
math-php - v1.10.0

Published by markrogoyski almost 4 years ago

Improvements

  • Bugfix (Issue 356): Fix Finance IRR NANs
math-php - v1.9.0

Published by markrogoyski almost 4 years ago

New Features

  • Vector min and max
  • Arithmetic isqrt (integer square root)

Improvements

  • Remove Travis CI (Moved CI to Github Actions in v1.8.0 release)
  • Rearrange non-code files
math-php - v1.8.0

Published by markrogoyski almost 4 years ago

Improvements

  • Improve permutations algorithm to be more efficient and more numerically stable
  • Qualify PHP function names with root namespace
  • Move CI to Github Actions
math-php - v1.7.0

Published by markrogoyski almost 4 years ago

New Features

  • Algebra linear equation of one variable
  • Rational number inverse
  • Rational number pow

Improvements

  • Improve combinations algorithm to be more efficient and more numerically stable
  • Internal Matrix class reorganization
math-php - v1.6.0

Published by markrogoyski about 4 years ago

New Features

  • Special function regularized lower incomplete gamma
  • Cereal sample data set

Improvements

  • Define boundary condition for lower incomplete gamma function
math-php - v1.5.0

Published by markrogoyski about 4 years ago

v1.5.0

New Features

  • Matrix LU solve
  • Matrix QR solve

Improvements

  • Bugfix (Issue 386) Matrix solve improvements
  • Matrix solve has optional method parameter to force a solve method
  • Bugfix ArbitraryInteger multiplication sign not taken into account
math-php - v1.4.0

Published by markrogoyski about 4 years ago

New Features

  • Multivariate Regular Grid Interpolation
  • Jensen-Shannon Distance
  • Canberra Distance
  • Search Sorted
  • Search ArgMax
  • Search NanArgMax
  • Search ArgMin
  • Serach NanArgMin
  • Search NonZero

Improvements

  • Divergence factored out of Distance into new Divergence class

Backwards Incompatible Changes

  • Legacy Distance divergences marked as deprecated (To be removed in v2.0.0)
Package Rankings
Top 0.5% on Packagist.org
Top 6.75% on Proxy.golang.org
Badges
Extracted from project README
Coverage Status Coverage Status