<p>I want to calculate Gauss-Hermite moments, such as h1,h2, h3, h4 moments from the values in an array of numbers which represent velocity distribution of stars in a galaxy. How would I fit a curve to these values that would be a Gauss-Hermite curve fitting and get the value of h1, h2, h3 and h4 using Python? For example, if I want to find standard deviation or mean of an array in python I can simply use np.std or np.mean. Is there any similar functions for Gauss-Hermite?</p>
<p>Please also share links or articles if relevant. Feel free to ask me if anything is unclear in my question. Thanks a lot!</p>
<p><strong>EDIT:</strong>
I found a post by MIchele Scipioni at <a href="https://mscipio.github.io/post/fitting-functions-to-data/" rel="nofollow noreferrer">https://mscipio.github.io/post/fitting-functions-to-data/</a>  which is doing something similar to what I am looking for but in a more complicated manner. I just want to be ale to fit the Gauss-Hermite polynomial of the following form [also presented in the post I have linked] to an array of data and be able to generate initial guesses for the input parameters automatically and get output fitted values for skewness and kurtosis :
<a href="https://i.sstatic.net/HSMjt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HSMjt.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-01-18T18:30:48.513Z
You checked https://numpy.org/doc/stable/reference/routines.polynomials.hermite.html ?
planetmaker
CC BY-SA 4.0
2022-01-19T06:36:37.140Z
@planetmaker, yes I did check the functions and examples on that reference page but I am not sure which function there can directly give the moments h1,h2,h3,4. Do you have any idea?
Jerome
CC BY-SA 4.0
2022-01-19T06:54:17.427Z
@planetmaker, could we use numpy.polynomial.hermite.hermfit? but honestly I think it would be better if we could define the gauss-hermite polynomial ourselves.
Jerome
<data-analysis><python><stellar-astrophysics><kinematics><map>
how to plot Gauss-Hermite moment maps from arrays of star velocity values in Python?
Jerome
# how to plot Gauss-Hermite moment maps from arrays of star velocity values in Python?

(Asked by: username_0 on 2022-01-18)

I want to calculate Gauss-Hermite moments, such as h1,h2, h3, h4 moments from the values in an array of numbers which represent velocity distribution of stars in a galaxy. How would I fit a curve to these values that would be a Gauss-Hermite curve fitting and get the value of h1, h2, h3 and h4 using Python? For example, if I want to find standard deviation or mean of an array in python I can simply use np.std or np.mean. Is there any similar functions for Gauss-Hermite?

Please also share links or articles if relevant. Feel free to ask me if anything is unclear in my question. Thanks a lot!

**EDIT:**
I found a post by MIchele Scipioni at <https://mscipio.github.io/post/fitting-functions-to-data/> which is doing something similar to what I am looking for but in a more complicated manner. I just want to be ale to fit the Gauss-Hermite polynomial of the following form [also presented in the post I have linked] to an array of data and be able to generate initial guesses for the input parameters automatically and get output fitted values for skewness and kurtosis :
[![enter image description here](https://i.sstatic.net/HSMjt.png)](https://i.sstatic.net/HSMjt.png)

**Tags:** data-analysis, python, stellar-astrophysics, kinematics, map

> **Comments:**
> **username_1**: You checked https://numpy.org/doc/stable/reference/routines.polynomials.hermite.html ?  
> **username_0**: @username_1, yes I did check the functions and examples on that reference page but I am not sure which function there can directly give the moments h1,h2,h3,4. Do you have any idea?  
> **username_0**: @username_1, could we use numpy.polynomial.hermite.hermfit? but honestly I think it would be better if we could define the gauss-hermite polynomial ourselves.  

---

## 0 answers

