How to fit Rayleigh PDF curve to a set of data? I have a set of a data that I acquired through a graph digitizer. It follows the contour of a piece of glassware and I would like to produce a function to fit the dataset. I have noticed that the function looks quite similar to the probability density function of a Rayleigh distribution (https://en.wikipedia.org/wiki/Rayleigh_distribution). The function is equal to $xe^{-x^2}$. How would I go about fitting the dataset I have to this function? Here is a link to the data: https://plotly.com/~ashok_a/1/

Considering the shape of the data it is obvious that the probability density function of a Rayleigh distribution is not a convenient model. This function tends smoothly to zero for $x$ tending to infinity which is far to be the case of the data which shows an abrupt deacrease around $x=37.$ It should be wasting time to use the Rayleigh model for a bad result.
The best should be to look for a better physical model.
In abscence of a convenient physical model one must be content with a purely mathematical model. One can try many kind of functions. For example a polynomial fraction might be a good candidat :
$$y(x)=\frac{ax^2+bx+c}{x-d}$$
They are a lot of softwares for non-linear regression. Any one will give a result such as :

The fitting is still not very good. Of course much better fit can be obtained with polynomial fractions made of polynomials of higher degrees.
