Fitting points to skewed sinusoids

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.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.
Back
Top