Fitting points to skewed sinusoids

Click For Summary

Discussion Overview

The discussion revolves around the challenge of fitting skewed sinusoidal functions to a set of data points represented as x-y coordinates. Participants explore methods for achieving a least squares fit for a specific non-linear function that incorporates skewness, with a focus on the parameters involved in the fitting process.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes the fitting problem involving a skewed sinusoidal function and seeks suggestions for fitting it to their data.
  • Another participant suggests using nonlinear regression and mentions the possibility of linearizing the function using Taylor series terms to form a least squares problem.
  • A different participant expresses skepticism about the feasibility of linearization, arguing that it complicates the process of determining the parameters A, phi, and alpha.
  • One participant mentions that Matlab's curve fitting toolbox could simplify the fitting process and provide confidence bands for the results.
  • Another participant counters that linearization is possible by using the constant and linear terms from the Taylor series, although they acknowledge the challenge of obtaining good initial guesses for convergence.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility of linearizing the fitting problem, with some advocating for nonlinear regression techniques and others questioning the practicality of those methods. The discussion remains unresolved regarding the best approach to fitting the skewed sinusoidal function.

Contextual Notes

Participants highlight the complexity of the fitting process due to the non-linear nature of the function and the challenges associated with obtaining accurate initial guesses for the parameters.

squalho
Messages
10
Reaction score
0
Fitting points to "skewed" sinusoids

Hello,

I have a problem related to least square fit of data. Let me start from a step back. I have a set of points, given as x-y coordinates. x represents an angle and y the corresponding value of a function. I am fitting sinusoids to those data points, and I am basically doing it like here: http://www.cheric.org/ippage/e/ipdata/2001/13/node6.html (see Curve Fitting with Sinusoidal Functions)

This works very well. I can reconstruct A0, A1 and B1 without problems. What I get is a sinusoid that represents the least square fit to my data points. Now comes my problem. The sinusoids that I have to fit are "skewed". Given a certain set of data, I have to fit a function of the kind:
<br /> y = A \cos (\omega + \arcsin (d \sin (\phi - \omega)) - \alpha)<br />
where A is the normal amplitude of the cosine, omega is the pulsation, alpha the phase, d and phi are what cause the "skewness". You can try to plot it to see that this function is like a cosine, but not symmetric.

Now, how would I go about fitting that function to my set of data? The problem is very non-linear and I'm stuck. Any suggestion is very appreciated.

Thanks!
 
Last edited by a moderator:
Mathematics news on Phys.org


It would seem you need to use nonlinear regression. Your same link has a topic about it but doesn't say much. I'm sure you can find descriptions via a Google search. Basically, you linearize the function using the first few Taylor series terms using a 'guess' for the solution, form the least squares problem, solve the resulting matrix equation for the unknowns, then repeat until you converge on a solution.
 


hotvette,

Thanks for the answer. However, it doesn't seem to me that the problem can be easily linearized. My problem is to find the values of A, phi and alpha. If I used a Taylor series expansion I would end up dividing my problem in many linear interpolators, each one working over a subset of my data. Each solution would give me the coefficients of each linear function (m and q), but then I would be back at the beginning, trying to guess my A, phi and alpha from my collection of m and q.

Does this make sense?
 


Matlab's curve fitting toolbox can also do this in a few clicks if you have it. It will even give you the confidence bands :wink:
 


squalho said:
However, it doesn't seem to me that the problem can be easily linearized

Sure it can. All that's needed from the Taylor Series is the constant and linear terms. If you have a function f = f(a,b,c) the linearization is:

f ≈ f0 + ∂f/∂a*Δa + ∂f/∂b*Δb + ∂f/∂c*Δc

(evaluated at current 'guesses' for a,b,c), which is linear in Δa, Δb, and Δc. It can be difficult sometimes getting good initial 'guesses' for the unknowns (to get convergence), but usually it can be done with a few attempts. Suggest you find some articles on nonlinear regression. It's actually quite straightforward once you get the hang of it.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 19 ·
Replies
19
Views
7K
Replies
6
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K