# How to make a twice-differentiable function that approximates some data?

I have some time series data that I would like to approximate with a twice-differentiable function. Each time series has ~10,000 datapoints, so I definitely do not want a function that passes through all these points. This rules out using InterpolatingFunction.

I have no mathematical model for these data at all, otherwise I would use LinearModelFit or NonlinearModelFit for this.

The only solution I can think of would be to perform some type of smoothing on the data (LowpassFilter?), and then somehow generate an approximating function object from the smoothed data.

Is there a built-in function for doing this sort of thing? (It's not that I think there's anything wrong with the recipe outlined above, but as a rule I prefer to use built-in methods over home-spun ones whenever possible.)

• What about splines? They should work pretty well. – Gregory Rut Jun 5 '15 at 20:27
• did you mean to say you "do not want to pass though" all the points? – george2079 Jun 5 '15 at 20:36
• @george2079: thanks! I just edited the post to add the missing "not". – kjo Jun 5 '15 at 21:12
• Here is a method I have used that smoothes and uses interpolation at the same time:mathematica.stackexchange.com/a/72037/12558 – Hugh Jun 5 '15 at 22:27
• If your datapoints are equally-spaced you can use the Savitzky-Golay filter. – Alexey Popkov Jun 8 '15 at 13:13