0

So all the data that I actually have is a picture of a histogram from which I can get heights and bin width, the median and one sigma errors.

The histogram is skewed, so the 16th and 84th quantile are not symmetric. I found that the median and the errors can be replicated with a skewed gaussian function, however the resulting histogram, from my found pdf, is difficult to match no mater how much I play with bin numbers and bin widths.

I understand that I can't possibly recreate the histogram exactly, but I will be very happy with something that is close enough.

My best idea is to loop through possible parameters of the skewed gaussian, make a histogram, somehow quantify the difference (like difference in heights at all points) and find best one. I think that might be a very long process though and I'm very sure there is something in scipy that does this quicker. Please refer me to anything useful if possible.

Anna
  • 85
  • 8
  • If you have spotted a distribution that might fit, you could normalize the histogram to a density and then do a least square fit of the parameters onto this histogram. However this is far from optimal - by using only the histogram you already lost a lot of information. – cel Jul 11 '16 at 05:35

1 Answers1

0

IMO your best shot is to treat the data as points and fit a function with scipy.optimize.curve_fit

This post might also help:

Community
  • 1
  • 1
Tarifazo
  • 4,118
  • 1
  • 9
  • 22