How do Fourier fit option guess the starting point?

2 views (last 30 days)
MR
MR on 16 Aug 2017
Edited: Shubham on 30 Aug 2024
I write this mail to ask for how Curve Fitting Toolbox guess the starting point. In this link, https://es.mathworks.com/help/curvefit/parametric-fitting.html, say that the starting point of a Fourier fit is “Optimized”. What method do matlab use to discover the best initial point?

Answers (1)

Shubham
Shubham on 30 Aug 2024
Edited: Shubham on 30 Aug 2024
Hello MR,
In MATLAB's Curve Fitting Toolbox, the process of determining starting points for fitting algorithms, including Fourier fits, is crucial for ensuring convergence to a good solution. While the documentation might refer to the starting points as "optimized," it typically means that MATLAB uses heuristics or algorithms to choose reasonable initial guesses.
Methods for Determining Starting Points:
  1. MATLAB often employs heuristic methods based on the data and the type of fit. For example, it might analyze the data to estimate initial parameter values that are likely to be close to the optimal solution.
  2. For functions like Fourier series, initial guesses might be based on characteristics of the data such as its range, mean, and periodicity. The toolbox could use the Fast Fourier Transform (FFT) to estimate frequencies and amplitudes as initial guesses for Fourier fits.
  3. MATLAB's fitting functions might use built-in algorithms that are specific to the type of model being fitted. These algorithms are designed to provide robust initial guesses that work well across a wide range of datasets.
  4. In some cases, MATLAB might use default values or simple rules (e.g., zero or one) for certain parameters if no better heuristic is available.
  5. The toolbox also allows users to specify their own starting points, which can be particularly useful if you have domain-specific knowledge that can guide the fitting process.
Fourier Fit Specifics:
For Fourier fits, MATLAB might use the following approaches:
  • The initial frequency and phase might be estimated using the FFT, which provides a rough idea of the dominant frequencies in the data.
  • Initial guesses for amplitude and offset might be derived from the data's range and mean.
Practical Tips:
  • Always check the fit results. If the fit does not converge well, consider providing your own initial guesses.
  • Use diagnostic plots like residuals and goodness-of-fit metrics to evaluate the fit quality.
  • Use the options available in the Curve Fitting Toolbox to experiment with different starting points and fitting algorithms.

Categories

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!