# 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. – Nameless Oct 20 '13 at 14:49
@Nameless Thanks very much for the pointer. Any recommendations for how to create a smooth interpolation that maintains the peak throughout? – Alec Oct 20 '13 at 23:19
What do you mean "maintain the peak throughout"? – Nameless Oct 20 '13 at 23:40
@Nameless I've edited the question with graphs to clarify – Alec Oct 21 '13 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). – Nameless Oct 21 '13 at 13:12