Skip to main content

Will build univariate using an optimized Horner method and multivariate polynomial using a somewhat optimized Horner method

Project description

polyhorner

This package will:

  • build univariate polynomials using an optimized Horner's method and fast numba loops
  • build multivariate polynomials using a somewhat optimized Horner's method and fast numba loops

univariate polynomial example

Suppose you have x, and y data, and you want to model y = a0 + a1 x + a2 x^2 + a3 x^3 + a4 x^4 Let Mat be a numpy matrix of size (N,1), where N is the number of data points. X = polyhorner.horner(Mat, 4) will build your X matrix ready for the regression (optimized using Horner's method)

multivaraite polynomial example

Suppose you have x, y, and z data, and you want to model using apolynomial of order 3 in x, and 2 in y, with cross-products z = a0 + a1 x + a2 x^2 + a3 x^3 + a4 y + a5 y^2 + a6 xy + a7 x^2y + a8 x^3y + a9 xy^2 + a10 x^2y^2 + a11 x^3y^2 let Mat be a numpy matrix of size (N,2), where N is the number of data points. let Expo be a numpy matrix of size (2,1) = (3,2) X = polyhorner.horner(Mat, Expo) will build your X matrix ready for the regression (semi-optimized using Horner's method)

I use some functions distributed under the GNU LGPL license from https://people.sc.fsu.edu/~jburkardt/py_src/monomial

Thanks to Pssolanki for helping fix issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyhorner-1.0.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

polyhorner-1.0.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file polyhorner-1.0.3.tar.gz.

File metadata

  • Download URL: polyhorner-1.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.7

File hashes

Hashes for polyhorner-1.0.3.tar.gz
Algorithm Hash digest
SHA256 12a9d17154a19c101bd464de2dc310cd7e3ff6aea58289ebdac28976bee177f6
MD5 b28684b35cc4eac12fbaf37980a2e8b7
BLAKE2b-256 63672e26f3addce055aa4e7b5e5f14e8ea0bc36e866e3e0ef199f2034c36879e

See more details on using hashes here.

File details

Details for the file polyhorner-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: polyhorner-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.9.7

File hashes

Hashes for polyhorner-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06cf4865c2ad73fc81dd3f08272719b768d20985dd8b914d2a3d993aaae4765d
MD5 393671a31b94a6599f456516c9eefc07
BLAKE2b-256 d3bee3fca1a54c8c8106e1a1676fcc32bd7a33ccdd84dc3c7c0edab99c05f8d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page