0

I have some astronomical data that I want to fit a sine wave to.

I want to fit something of the form y = Asin(Ωt+Φ). I know the period of the sinusoid is equal to a sidereal day. So I know the frequency Ω. So, I just need a way to find out optimal values for A and Φ.

Now, since the period of the sinusoid is so huge and we can track a source only to an extent of about 6 hours, I never get data that would have a full cycle of a sine wave in it. most of the cases I might have only 25 percent of it. In this situation where I don't even have a full cycle, what is the best way to estimate the value of the amplitude and phase of the sinusoid?

Vivek V K
  • 161
  • Related: http://stats.stackexchange.com/questions/60994/fit-a-sinusoidal-term-to-data – qwr Aug 12 '14 at 05:57
  • This appears to be an almost-immediate reposting of https://math.stackexchange.com/q/902166/139123 – David K Jul 10 '23 at 11:02

3 Answers3

1

So, you have to fit the model $$y=A \sin(\Omega t+\Phi)$$ based on $N$ values $(t_i,y_i)$ . This model is nonlinear with respect to its parameters but, fortunately, you know the value of $\Omega$.

Suppose that you assign a value to parameter $\Phi$; so the model simply write $y=A x$ with $x=\sin(\Omega t+\Phi)$. So, parameter $A$ can immediately be obtained by a linear regression without intercept $$A(\Phi)=\frac{\sum _{i=1}^N x_i y_i}{\sum _{i=1}^N x_i^2} $$ and the corresponding sum of squares $SSQ(\Phi)$ of residuals can be computed. So, you need to find an approximate value of $\Phi$ which minimizes $SSQ$; to do this, the simplest is to generate the plot and visually locate the minimum. At this point, you then know $A$ and $\Phi$ and you can safely start a full nonlinear regression.

0

You can directly fit the sine function to your data. It's a nonlinear fit and thus in danger of getting stuck in a local minimum (especially with an oscillatory function), but if the initial conditions are right, it shouldn't be a problem (any non-excel program should work out of the box).

If you had more than one period, FFT would be a reasonable choice, if you had equidistant data. However, it needs a window function to avoid aliasing. A better choice is MEM (maximum entropy method) for estimation of the power spectrum. It works via autocorrelation.

Still, when you really only have a single frequency (no contamination with other sinusoidals) and especially if you have less than one period, direct fitting is perfectly fine.

orion
  • 15,781
0

The usual methods are iterative and requires an initial guess of the parameters.

A straightforward method was recently published in the document : http://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales

pages 35-36 the method of sinusoidal fitting and the direct computation process (not iterative, no initial guess) is described.

The method is convenient for uncomplete sinusoid. In case of data on only a small part of arc of sinusoid, the experimental points must be sufficiently numerous and the experimental scatter must be low enough.

Eventually, you can use the results obtained thanks to this straightforward method as starting values of the parameters (instead of an initial guess) with a more conventional method, for even more refinement if necessary.

JJacquelin
  • 66,221
  • 3
  • 37
  • 87