I need some help understanding this numpy function called "numpy.polynomial.hermite.hermfit(x, y, deg, rcond=None, full=False, w=None)":https://numpy.org/doc/stable/reference/generated/numpy.polynomial.hermite.hermfit.html#numpy.polynomial.hermite.hermfit
It says in the documentation that it takes data and does a fitting to Gauss-Hermite polynomial and then gives the values of the coefficients. I want to know the following:
- What is the actual expression of the Gauss-Hermite polynomial they are fitting the data to?
- The documents states that the coefficients are returned according to the degree that is input into the function. Does this mean that if deg=2, the returned answers are h1 and h2? or if deg=4, they are h1,h2,h3,h4? The worked example in the doc doesn't explicitly state that.
Thanks lots.
The Hermite polynomials are a series of polynomials. It can be used similar as for example Taylor polynoms in a Taylor series for approximating a function. On wikipedia you can also find a list of the exact expressions (numpy uses the "physicist's" definition of the Hermite polynomials).
The function returns the coefficients of the hermite series expansion. So for example in a fit with degree
3the series expression isand the fit function returns the list
You can pass this list to the
np.polynomial.hermite.hermvalfunction to evaluate the whole expression.