This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.

 NumericalMath`TrigFit` The Mathematica function Fit does linear least-squares fitting to data. It allows any combination of basis functions. However, it is often the case that you want to do trigonometric fitting and it would be easier if you did not have to explicitly list the basis functions , , , , , . TrigFit does this for you. Fitting trigonometric series to data. TrigFit uses the function Fourier to quickly find a least-squares trigonometric fit to the data. In doing so it completely avoids casting the problem in terms of an overdetermined linear system and instead directly constructs the solution. It should be pointed out, however, that because TrigFit is based on Fourier, it must assume that the data come from equally spaced sample points and that the data cover exactly one period of a periodic function. Because of this restriction it was decided that TrigFit should not accept data in the form of ordered pairs. It thus only accepts a list of numbers, which are assumed to be sampled with spacing where period is the period of the function and is the number of elements in data. Note that the first datum corresponds to (default value 0). Because the function in question is assumed to be periodic, the first datum also corresponds to (or if is not specified) and the last datum corresponds to . This loads the package. In[1]:= <