Sinusoidal Regression & Model Fitting
- Fit a sinusoidal model to periodic data by estimating its four parameters
- Judge whether periodic data is well described by a single sinusoid
- Explain the limits of extrapolating a sinusoidal model
Four parameters, estimated in order
Given periodic data, extract the four parameters in a fixed sequence and the fit almost writes itself. Midline k = (max + min)/2. Amplitude a = (max − min)/2. Period from the observed cycle length, then b = 2π/period. Phase h from a landmark — the location of a maximum if you are modeling with cosine. This estimate is usually within a few percent of what regression software returns.
Average monthly high temperature in a city peaks at 29°C in July (month 7) and bottoms at 3°C in January (month 1). Fit a sinusoidal model with t in months.
- 1.Midline: k = (29 + 3)/2 = 16.
- 2.Amplitude: a = (29 − 3)/2 = 13.
- 3.Period: annual temperature cycles once per year, so 12 months. b = 2π/12 = π/6.
- 4.Landmark: the maximum is at t = 7, and cosine peaks at argument 0, so h = 7.
- 5.Model: T(t) = 13·cos((π/6)(t − 7)) + 16.
- 6.Check January: T(1) = 13 cos((π/6)(−6)) + 16 = 13 cos(−π) + 16 = −13 + 16 = 3. ✓
When one sinusoid is not enough
A single sinusoid is symmetric: it spends equal time above and below the midline, rises and falls at mirror-image rates, and has identical peaks and troughs. Real periodic data often violates this. Tides have two unequal highs per day. Daylight hours change faster near the equinoxes than a pure sinusoid predicts. Electricity demand has a sharp evening peak and a broad overnight trough. The residual plot reveals it: a systematic pattern within each cycle, repeating cycle after cycle, means the shape is wrong even when the period is right.
Sinusoidal models cannot be extrapolated indefinitely. A temperature model fitted to one year predicts the same cycle forever, capturing no trend at all — so it will steadily diverge from data in a warming climate. Periodicity is an assumption imposed by the model, not a fact discovered in the data.
Data on daily high tide height has maximum 4.6 m and minimum 1.2 m. What are the midline and amplitude?
Separating trend from cycle
When data both cycles and drifts, a pure sinusoid cannot fit both. The standard approach is to model the sum: f(t) = (trend) + (sinusoid), for example f(t) = 0.02t + 13cos((π/6)(t − 7)) + 16, where the linear term captures a slow warming and the sinusoid captures the seasons. Fitting only the sinusoid leaves the trend in the residuals, where it appears as a slow drift from negative to positive across the whole record — a distinctive and easily recognized signature.
Monthly measurements of atmospheric CO₂ show a steady rise plus an annual wiggle of about ±3 ppm. What model form is appropriate, and what would a pure sinusoid leave behind?
- 1.Two features are present: a long-run increase and a 12-month cycle.
- 2.A sinusoid alone has a constant midline, so it cannot represent the rise.
- 3.A line alone has no periodicity, so it cannot represent the wiggle.
- 4.Combine them: C(t) = (mt + b) + 3·sin((π/6)(t − h)), with m from the long-run slope.
- 5.Fitting only the sinusoid would leave residuals that climb steadily across the record.
A sinusoidal model is fit to monthly data. The residuals are small but show the same up-down pattern within every single year. What does this indicate?
Answer the 2 checkpoints as you read.
Sign in to save your progress