# How to pick up points of SmoothHistogram

I have some data, and I used SmoothHistogram to obtain a curve. Now I would like to pick up several points on the curve such that I can fit this curve to a function. I get stuck with picking up points. Can anyone help me with this?

• Post the code you used to generate the plot please. – Bob Brooks Nov 21 '17 at 14:58
• What function do you have in mind? I ask for two reasons: (1) If you have some particular probability density function in mind, you'd be better off using the original data and use maximum likelihood and (2) If you're considering a regression, note that the variance about the curve will not be equal across all values (which is usually the default assumption for most regression functions). – JimB Nov 21 '17 at 15:46
• If your raw data is in x, then you can generate a list of points with skd = SmoothKernelDistribution[x]; Table[{y, PDF[skd, y]}, {y, 0, 10, 0.01}] (but adjusting the y values to match what you need). That way you have explicit control as to the values of y that you want the pdf to be evaluated. – JimB Nov 21 '17 at 15:50

## 1 Answer

If you just want the points, you can get them out of the Graphics object (remember that everything in Mathematica is a list of lists):

rands=RandomReal[1, 1000];
pts=SmoothHistogram[rands][[1, 2, 1, 3, 3, 1]]
ListPlot[pts] 