What is Curve Fitting?#

Curve fitting in time series analysis is a mathematical method of constructing a curve to best fit a series of points either for regression analysis or extrapolation. The best curve is calculated by minimizing the distance between the data points and the point on the curve.

Curve fitting algorithms#

There are various curve fitting algorithms available with varying degrees of complexity and accuracy:

  • Linear regression: This is the simplest type of curve fitting where the algorithm aims to find a straight line that best fits the data points. The algorithm is most often taking the ordinary least squares to minimize the distance using linear algebra.
  • Polynomial regression: For data sets where linear regression does not fit the data well, polynomial regression may be used to apply higher degree polynomials. For example, if the data looks parabolic or grows at an exponential or logarithmic shape, polynomial functions may describe the data better.
  • Non-linear regression: If neither linear nor polynomial regression fits, there may be more complex functions like sigmoid function, Gaussian, Lorentzian, or Voigt functions that may fit the data better.

Curve fitting with time series data#

With time series data, curve fitting is a powerful tool for analyzing trends and establishing a relationship between time and the value at hand. Curve fitting is often used for:

  • Interpolating missing data
  • Smoothing out noisy data
  • Extrapolating to future time points for predictive analytics
  • Identifying anomalies
  • Establishing causal relationships