Re: fitting points to a sin function



"Rafael Herrejon" <rafael.erasethis@xxxxxxxxxxxxxxxxxx> wrote in message
<fpua8u$aqi$1@xxxxxxxxxxxxxxxxxx>...
"John D'Errico" <woodchips@xxxxxxxxxxxxxxxx> wrote in
message <fpu7mu$j82$1@xxxxxxxxxxxxxxxxxx>...
Why do you think that this arbitrary cloud
of points has a sine wave as a model?

This "arbitrary" cloud of points is the calculated angle of
a coin rotating, observed by a camera.

Why do you think that this particular sine
model is correct?

the coin is rotating on its z-axis, the angle would go from
0 to 90 degrees..


What do the exact zeros in your data result
from?

they are not missing values. The values are calculated with
theta=cos(b/a) where b is the minor axis of the ellipse and
a is the major axis of the ellipse, when the minor axis is
equal to the major axis, the angle of the coin is 0.

If they are missing values, then don't
you think that the modeling will have
difficulties dealing with missing data that
are replaced with exact zeros?

if you plot the last 20 points u can see that an abs(sin)
could fit. Again is least squares fitting, even the fitting
is not perfect, should be able to get some results closer
to the ones im getting
---------
If this data represents the angle of a rotating coin, do you actually mean
theta = arccos(b/a) instead of cos(b/a)?

If xdata represents elapsed time and ydata is this theta, one would expect
that the total angle of revolution of the coin would be linear in time because
of conservation of angular momentum, provided you allowed the angle to go
beyond the artificial limits of 0 to pi/2 (and provided the rotation is about a
line in the coin instead of a coin wobbling about a skew line.) Such a straight
line is not a good candidate for fitting with a sine curve. By constraining it to
the range 0 to pi/2 it would behave like a ball bouncing between two parallel
y-limit walls following a straight line between limit. This is still not a very apt
candidate for fitting with a sine curve.

If the major axis, a, remains fixed, I would think you would want to do a sine
fit as a function of time on the value, b/a, itself except that you would want
to reverse its sign each time it passed through zero.

Finally, as a general comment, it seems to me that you have not allowed for
the very important possible phase shift in your three parameters, A, B, and C.
You ought to be using four parameters,

A*sin(B*x+C) + D,

in my opinion, to allow for the full generality of a sine fit.

Roger Stafford


.



Relevant Pages

  • Re: Vernier caliper accuracy
    ... you can build a stack of blocks which will achieve the small angle you ... what's a sine plate used for? ... It is a plate ... For a sine bar, there is no captive base plate, so you set it on ...
    (rec.crafts.metalworking)
  • Re: Sine code for ANSI C
    ... >> compute the sine of small arguments quickly, but if it has to take ... > angle is greater than pi. ... All the library writer knows is that there's little *precision* ... small arguments it radians are easy to compute. ...
    (comp.lang.c)
  • Re: Calculating Pi
    ... when you take the sine of a small angle, ... This method leads naturally to ... then sin x is very nearly 0. ...
    (sci.math)
  • Re: History of trigonometry
    ... "The first actual appearance of the sine of an angle appears in the work ... Now as the chord ... I would observe that the fact that I use a reference doesn't ...
    (sci.math)
  • Re: OT: Macro Lens for Coin Photography
    ... >Wide angle, or not? ... Well, here's a link to a calculator that might help, but the ... math gets a bit complicated. ... coin. ...
    (rec.collecting.coins)