Let’s say I have a function, which is a time series of data points, I am trying to find a polynomial of fixed sine's and cosines that bests approximate the data points. I know Chebyshev Approximation is popular tool to approximate a dataset function with a polynomial. I am trying to approximate the function with a trigonometric polynomial that finds the optimal coefficients and periodicities for each cosine/sine term that best minimizes the error. I have done this before using trigonometric regressions to find a best fit for a time series but my problems with trig regressions is there are infitinitly many periodicities to test. Is there an approximation method that can be used to approximating the best coefficient on each cosine/sine and the optimal periodicity that best fits the data? Thank you!
Working on trigonometric polynomial decomposition, the first step is to take a big look at Fourier transformation.
It is very powerfull, well documented and probably well implemented on your favorite language.
It will give you the decomposition of your time series. You can remove highest frequencies, which correspond to noise, to have a good estimation.
Building upon +Imorin answer, you should have a look specifically at discrete cosine transforms. It's a standard approach when trying to express finite sequences as a sum of cosines. I would start from there, especially as it's implemented in every common language (R, Matlab, Python for starters). Only then evaluate if you need more.