Re: fitting points to a sin function
- From: "Roger Stafford" <ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Feb 2008 01:30:21 +0000 (UTC)
"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'tif you plot the last 20 points u can see that an abs(sin)
you think that the modeling will have
difficulties dealing with missing data that
are replaced with exact zeros?
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
.
- Follow-Ups:
- Re: fitting points to a sin function
- From: Rafael Herrejon
- Re: fitting points to a sin function
- References:
- fitting points to a sin function
- From: Rafael Herrejon
- Re: fitting points to a sin function
- From: John D'Errico
- Re: fitting points to a sin function
- From: Rafael Herrejon
- fitting points to a sin function
- Prev by Date: Plotting
- Next by Date: Re: fortran code into matlab code
- Previous by thread: Re: fitting points to a sin function
- Next by thread: Re: fitting points to a sin function
- Index(es):
Relevant Pages
|