Find Sine function without given Minimum

78 Views Asked by At

So, recently for a grade 11 school math project, I collected data, which I knew took a form of a sine graph, but the values which experimented to find were chosen randomly. Faith the data collected, I got the maximum point, but did not include the minimum point. So is there a way to find an equation of sine regression if no minimum is given/shown?

1

There are 1 best solutions below

7
On

Given $n$ data points $(x_i,y_i)$ for a sine wave means fitting the model $$y=A+B\sin(Cx+D)$$ and it is a quite difficelt task (google for fitting a sine wave).

From a practical point of view, it is easier to expand the sine term and consider instead $$y=a+b\sin(cx)+d\cos(cx)$$ Taking into account the fact that your $x_i$'s are given in degrees, I prefer to rewrite the model as $$y=a+b \sin \left(c\frac{\pi x}{180}\right)+d \cos \left(c\frac{\pi x}{180}\right)$$This problem is nonlinear (because of the $c$ parameter). If $c$ was known, it would just be a multilinear regression easy to do.

So, for the time being, give $c$ a value; for this value, compute $a,b,d$ and the sum of squares $SSQ$ (all of that can easily be done using Excel). Now, plot $SSQ$ a a funtion of $c$ and locate its minimum. When done, you have all the estimates required for the nonlinear regression for a fine tuning of the parameters.

Using the data you posted, $c=4.5$ seems to be a good candidate. Using this value and the corresponding $a,b,d$ obtained by the preliminary multilinear regression, a nonlinear regression will give $$a=34.442 \qquad b=6.987 \qquad c=4.526 \qquad d=8.002$$ For these values, the table below reproduces your data and the predicted values from the regression $$\left( \begin{array}{ccc} x & y & \text{predicted} \\ 90 & 48.88 & 45.003 \\ 68 & 33.98 & 33.820 \\ 41.2 & 26.58 & 25.704 \\ 33.2 & 30.72 & 30.960 \\ 20.4 & 38.59 & 41.098 \\ 0 & 40.28 & 42.445 \end{array} \right)$$ which is not fantastic even if $R^2=0.9968$ seems to be be quite good.

Now, taking the derivative of $y$ with respect to $x$ $$y'=\frac{\pi c}{180} \left(b \cos \left(c\frac{\pi x}{180}\right)-d \sin \left(c\frac{\pi x}{180}\right)\right) $$and solving the trigonometric equation $$b \cos \left(c\frac{\pi x}{180}\right)-d \sin \left(c\frac{\pi x}{180}\right)=0 \implies x=\frac{180 }{\pi c}\tan ^{-1}\left(\frac{b}{d}\right)$$ gives $y_{max}=45.066$ at $x=88.63 ^{\circ}$ and $y_{min}=23.819$ at $x=48.86 ^{\circ}$.