How to Forecast Seasonal Time Series with the Seasonal Coefficient Method
Learn a step-by-step approach to predict seasonal time series—such as product sales or climate data—using the seasonal coefficient method, illustrated with a quarterly refrigerator sales case study and a complete Python implementation that computes next year's quarterly forecasts.
Forecasting Seasonal Time Series
Seasonality can refer to natural seasons or product sales cycles; many economic activities generate seasonal time series, such as air‑conditioner production or seasonal clothing sales.
Accurately fitting the entire curve of a seasonal series is difficult, but the goal is to capture the trend. One practical technique is the seasonal coefficient method, whose steps are:
(1) Collect data for each quarter (or month) of several years; the index i denotes the year and j the quarter/month.
(2) Compute the arithmetic mean of all quarters (or months) for each year.
(3) Compute the arithmetic mean for each quarter (or month) across years.
(4) Calculate the quarter (or month) coefficients.
(5) Forecast: for a quarterly series, first obtain the weighted annual average for the next year, then the quarterly average, and finally the forecast for each quarter.
In the formula, S_i is the total for year i, W_i is the weight (natural numbers 1,2,…), and the forecast for quarter j of the target year is obtained by multiplying the quarterly coefficient by the predicted quarterly average.
Case Study
Problem
A store recorded refrigerator sales (in ten‑thousand yuan) for three years, 12 quarters. Predict the sales for each quarter of 2004.
Using Python, the predicted 2004 quarterly sales are 269.7534, 407.0263, 377.5862, and 315.9674 (ten‑thousand yuan).
Code
import numpy as np
a=np.loadtxt('data/refrigerator.txt')
m,n=a.shape
amean=a.mean() # overall mean
cmean=a.mean(axis=0) # column means
r=cmean/amean # seasonal coefficients
w=np.arange(1,m+1)
yh=w.dot(a.sum(axis=1))/w.sum() # weighted annual forecast
yj=yh/n # quarterly average for forecast year
yjh=yj*r # quarterly forecasts
print("下一年度各季度的预测值为:",yjh)Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Model Perspective
Insights, knowledge, and enjoyment from a mathematical modeling researcher and educator. Hosted by Haihua Wang, a modeling instructor and author of "Clever Use of Chat for Mathematical Modeling", "Modeling: The Mathematics of Thinking", "Mathematical Modeling Practice: A Hands‑On Guide to Competitions", and co‑author of "Mathematical Modeling: Teaching Design and Cases".
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
