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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for polyhorner-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be2404565302a316a0d1fcaa4b6a8cce64951b9e4b7d8104c2757837d840923 |
|
MD5 | 53d85b0ff3c2f7f31fa1ebb4a6968197 |
|
BLAKE2b-256 | 566a5e1e00c4c7071f88116e10f8ed705041af925b471237275da859731bb387 |