# How to calculate a frequency curve from a sample of values, and interpolate between curves

I have a set of about 500 values, from which I'm currently plotting a histogram.

I'd like to plot a frequency curve, i.e. go from the left two graphs to the rightmost on the below image borrowed from Wolfram MathWorld.

If I can manage this, I'll then have frequency curves for various points in time. I'd like to smoothly interpolate between them.

i.e. if I have a frequency curve at 1 month, another at 3 and another at 6, I'd like a function that accepts a range and a time, and returns the approximate frequency of that range at that point in time.

I don't really know where to begin with this. Any pointers on what I should read up on to accomplish this? And any ideas as to how can I go about doing it?

Edit

By "maintain the peak throughout" I mean that interpolating between two curves like these two:

Should not result halfway in a curve that looks like this:

But should look like this:

• What you are looking for is kernel density estimation. This can be done with any reasonable statistics software. Oct 20, 2013 at 14:49
• @Nameless Thanks very much for the pointer. Any recommendations for how to create a smooth interpolation that maintains the peak throughout?
– Max
Oct 20, 2013 at 23:19
• What do you mean "maintain the peak throughout"? Oct 20, 2013 at 23:40
• @Nameless I've edited the question with graphs to clarify
– Max
Oct 21, 2013 at 12:09
• Yes, you can do that with kernel density estimation. It depends on the bandwidth whether two peaks are summarized in one (large bandwidth), or whether they remain (smaller bandwidth). Oct 21, 2013 at 13:12