Example 4: Report and interpret the best-fit sinusoidal model for the dataset to the right, which records the amount that the average Fahrenheit temperature for a month is above or below the average temperature for the entire two-year period. The months are numbered starting with 1 for January 2003.
[i] Copy the dataset to the Data Scratch Pad worksheet and display a scatter plot.
[ii] From the graph, make rough estimates of the amplitude and wavelength for the data, so that you will have values to use as initial parameter settings.
[iii] Use the model formula explained in this section to create a sinusoidal model worksheet from the General Model template in Models.xls, with parameters for wavelength, phase, and amplitude. Set the wavelength and amplitude parameters to the values you estimated in step [ii] above (leaving these parameters blank or zero will cause errors or confuse Solver).
[iv] Copy the dataset to the worksheet, then spread the formulas in columns C, D, and E down to match the data, as usual.
[v] Use Solver to find the best-fit parameters, and report your results.
The best-fit sinusoidal model to this data has a wavelength of 11.9 months, a phase shift of 4.0 months, an amplitude of 23.3 degrees F, and a baseline average of 69.1 degrees F. The standard deviation for the fit is 2.8 degrees F.
Interpretation: The monthly temperature-difference averages at the location this data came from range by about 23 degrees above and below the yearly average of about 69 degrees. The pattern repeats about every 12 months, with the maximum-positive-slope point (i.e., spring) in April (month 4). Individual monthly averages can be expected to be within 2.8 degrees of this model about 2/3 of the time.
The final worksheet should look similar to this:
|x||y data||y model||Residual||Squared||y = $G$5 * SIN((x-$G$4)*6.2832/$G$3)|
|6||91.9||90.08||1.82||3.3073||Model and data value counts|
|7||92.9||92.89||0.01||0.0002||3||Number of parameters|
|8||84.8||89.28||-4.48||20.0901||24||Number of dev. averaged|
|10||69.1||68.31||0.79||0.6226||Goodness of fit of this model|
|11||60.1||56.72||3.38||11.3938||169.8698||Sum of squared deviations|
Sinusoidal cycles and phases
Cycles: There is a close relationship between sinusoids and rotation. A spinning object repeats its sequence of positions every rotation, and the height of a point on a circle rotating at a constant speed varies over time according to a sinusoidal pattern. The wavelength of this sinusoid equals the rotation time of the circle, and the amplitude equals the radius of the circle. The phase is how long it has been since the point last passed the midpoint in an upward direction. The baseline is the height of the center of the circle.
Left-right shifts of the sinusoidal pattern: The standard sinusoid crosses the y axis where the curve has the steepest upward slope, where it is increasing past the average value. But the curve can be shifted right or left so that it crosses the y axis at some other point of the cycle. The distance from the nearest standard steepest-slope point to the actual crossing point is called the phase or the phase shift of the sinusoid. The phase shift is added to the x value before it is used inside the SIN function.
Two sinusoidal processes with the same wavelength can be in phase, in which case they will add together if they apply to the same measurement, or be out of phase, in which case there may be partial cancellation. Sometimes phase shifts are talked about in terms of angular degrees (e.g., “The electric and magnetic waves are 90 degrees out of phase”); this is based on taking a wavelength as being 360 degrees due to the analogy with rotation), so a phase shift of 90° means a phase shift of ¼ of the wavelength.