1

I have a set of data points that are measured points of a bore and that are not equally spaced, and I would like to fit a sine curve to them. Could you help me, please? We would like to examine the shape differences between this bore and a perfect circle shaped bore.

I have had a look at this question, but the solutions either assume equal spacing or assume that a parameter is known. I have had a look at this too, but the author has points with equal spacing (they mention FFT as an option).

I would like to fit a curve to a series of data points in the following form:

y(x) = K + A * sin[o*(x+c)]

where K, A, o, and c are the real paramters I am looking for, assuming that o is an integer in the interval [1;25].

Sample bore data.

Thank you in advance!

Edit: I added the physical meaning of the points, and sample data.

Lemongrass
  • 11
  • 4
  • As I understand it, with no parameter *constraints* a very high frequency sine wave might be found that perfectly fits the data. So some limit on the maximum frequency might be needed to prevent this. For equally spaced data this would be based on Nyquist's theorem, if the data is not equally spaced then judgment or an approximation based on Nyquist's sampling theorem must be used to prevent or mitigate this known sine fitting behavior. – James Phillips Jul 11 '18 at 12:58
  • Would you please post a link to your data? I can write a simple Python fitting script (with some constraints) if Python is OK for you. – James Phillips Jul 11 '18 at 18:57
  • Thank you! :) These are the points of the bore: https://paste.ee/p/6nTrD We would like to examine the shape differences from a circle. We assume that the frequency (o) should be an integer in interval [1;25]. – Lemongrass Jul 23 '18 at 14:29
  • Having looked at a scatterplot of your data, and having read your comment, I understand the problem. In equation fitting for "y = f(x)" such as the sine equation in your question, the fitted equation will yield a single value of "y" for a single value of "x". Your data is in the shape of an ellipse, and cannot be fitted to your posted equation. I think you should consider ellipse fitting rather than equation fitting. The difference in a fitted ellipse and a fitted circle could then be compared. – James Phillips Jul 23 '18 at 17:08

0 Answers0