Unit 4

Time Series and Text Data

Time Series Forecasting and Text Data · Data, Models, and AI-Empowered Decision Making
4.1 Time-Series Foundations 4.2 Forecasting Methods and Error 4.3 CCW Seasonal Factors 4.4 Causal Forecasting 4.5 Text Data and LLM Labelling 4.6 Summary and Assignment 5 interactive demonstrations · 5 classroom exercises
How to use this e-textbook. Orange panels are interactive demonstrations where changing parameters or methods recalculates charts and error metrics immediately. Green panels are classroom exercises; complete them and select “Check” for feedback and reference values. This page uses real course data:daily average call volume for 12 quarters at the CCW call centre,a 12-period sales series,CCW sales and call volume, and 100 Chinese product reviews.

4.1 Time-Series Foundations

Unit 3 regression uses cross-sectional data—different objects observed at one point in time. This unit uses a different structure: observations of the same object at different points in time. Forecasting separates a pattern from history and projects it one step into the future.

Time-Series Data and Cross-Sectional Data

Time series

observations of the same object at different points in time, such as daily average call volume by quarter or monthly sales of a product.

Cross-sectional data

observations of different objects at one point in time, such as average house prices in 90 cities in one year.

Four Components of a Time Series

1 Raw series = trend + seasonality + randomness 2 Trend component: long-term increase or decline 3 Seasonal component: a pattern that repeats over a fixed cycle (Cyclical factors are longer and irregular; random factors have no pattern.)
Time-series forecasting separates the first three components and extrapolates them.

Time-Series Models versus Regression

ComparisonRegression modelTime-series model
Source of explanationUse other variables to explain current YUse past values of the same series to predict future values
RequirementInformation on independent variables must be availableRelies only on the series’ own history
Can they be combined?Yes: first forecast sales (time series), then use sales to forecast call volume (regression)—this is the causal forecast in Section 4.4

Example: Six Months of Fastchips Sales

Month123456
Sales (thousand units)172524263028

What should be the forecast for month 7?Different methods produce different answers—the naïve method forecasts 28, the average method forecasts 25, and a moving average gives yet another value. The method should match the stability of the data.

Six Forecasting Methods and Their Applicability

MethodApproachSuitable data
Naïve methodUse the most recent value as the forecastVery unstable, with little or no relation between adjacent periods
Average methodUse the mean of all historical dataVery stable, with the oldest and newest observations equally representative
Moving averageUse the mean of the most recent n periods; the user chooses nReasonably stable, with only recent periods relevant to the future
Exponential smoothingGive the newest observation the highest weight, with older observations receiving lessVarious stability levels; α controls sensitivity to the newest observation
Exponential smoothing with trendAdd a trend estimate to the smoothed levelClear trend that changes slowly
Linear regressionFit a trend line using time as the independent variable and extrapolate itStable-trend series for which time is a meaningful independent variable
Exponential smoothing: Ft = α × newest value + (1 − α) × previous forecast Larger α makes the forecast more sensitive to the newest observation
Interactive Demonstration 1

Four Forecasting Methods on One Chart

Use the real 12-period sales series. Adjust n and α to see how the four methods change and how MAD and MSE respond. The final period is reserved for each method’s forecast.

Moving-average window n:
Smoothing constant α:
Actual Naïve method Average method Moving average Exponential smoothing

Measuring Forecast Error: MAD and MSE

  • MAD(mean absolute deviation) is the average absolute forecast error and measures the typical size of error.
  • MSE(mean squared error) is the average squared forecast error and penalises large errors more heavily.
  • Both measures depend on units, so comparisons must use the same series and the same evaluation interval.
  • Error is defined as actual − forecast, which has both positive and negative values; take the absolute value or square it before computing MAD and MSE.
Classroom Exercise 1

MAD of Four Methods on This Series

Using the 12-period sales series (23, 24, 22, 28, 22, 27, 20, 26, 21, 29, 23, 28) and the parameters above, calculate MAD for the four methods (two decimals; 5% tolerance).

4.2 The CCW Case and Seasonal Factors

Case: Forecasting Call Volume at CCW

CCW sells low-cost computers directly by telephone and operates its call centre around the clock. Lines are limited and new customers cannot get through when all lines are busy, so staffing must be planned in advance and call volume must be forecast. The data are daily average call volume in each quarter for the past three years.

CCW’s Current Practice: The 25% Rule

Call volume is relatively stable except around Christmas. The company assumes each quarter is the same and only Q4 is 25% above the other quarters:

  • Forecast for next year’s Q1 = actual Q4 ÷ 1.25
  • Forecasts for Q2 and Q3 = previous quarter’s actual value
  • Forecast for Q4 = 1.25 × Q3 actual value
YearQ1Q2Q3Q4Annual average
Year 16,8096,4656,5698,2667,529.25
Year 27,2577,0647,7848,724
Year 36,9926,8227,9499,650
Quarterly average7,019.336,783.677,434.008,880.00—
Seasonal factor0.93230.90100.98731.1794Total 4.0000

Using Q5–Q12 as the comparison interval, the 25% rule’s MAD = 519.9, MSE = 420,476.

Seasonal Factors and Deseasonalisation

  • Seasonal factor = quarterly average call volume ÷ overall mean, measuring how far the quarter is above or below the annual average.
  • The four seasonal factors sum to 4.
  • Deseasonalised value = actual value ÷ seasonal factor for that quarter. Removing seasonal variation makes the trend easier to see.
Interactive Demonstration 2

Seasonal-Factor and Deseasonalisation Workbench

Switch views to see the “sawtooth” in the actual series and the trend that remains after deseasonalisation. Quarter lines vary in colour intensity according to the size of the seasonal factor.

Annual average
Q1 factor
Q2 factor
Q3 factor
Q4 factor

Three Steps for Forecasting Call Volume

  1. Choose a time-series forecasting method.
  2. Apply it to the deseasonalised series to obtain a deseasonalised forecast.
  3. Multiply the forecast back by the seasonal factor for the corresponding quarter to obtain the final forecast.
The order cannot be reversed: smoothing the raw series treats seasonal fluctuation as part of the trend and magnifies error—the main reason the 25% rule performs worst.
Classroom Exercise 2

Calculate the Four Seasonal Factors

Using the three years of data above, calculate the seasonal factor for each quarter (four decimals; 1% tolerance). The four factors should sum to 4.

Classroom Exercise 3

Make Four Forecasts with the 25% Rule

Year 2 actual values are 7,257, 7,064, 7,784 and 8,724 for Q1–Q4, and Year 1 Q4 is 8,266. Use the 25% rule to forecast all four quarters of Year 2.

4.3 How Methods Perform on the CCW Data

This section answers one question: once seasonality is handled, how much do simpler forecasting methods actually differ? The answer may surprise you.

Interactive Demonstration 3

Error Comparison across Six Methods

Recompute every method on the same interval (Q5–Q12) with the same seasonal factors. Select a method to inspect its forecasts and errors, or use the ranking table below.

Method:
MAD for this method
MSE for this method
Ranking (by MAD)

Conclusion: The Method Is Not the Main Issue

  • The current 25% rule has MAD = 519.9, the largest error among the six approaches.
  • After seasonal adjustment, the naïve method reduces MAD to 272.4.
  • Once seasonality is removed, the simple methods perform similarly.
  • Recognising seasonality matters far more than choosing one smoothing method over another.
  • MAD within the exponential-smoothing family changes with initialisation and parameter choices. This page consistently uses F₁ = first-period actual value and α = 0.3; the Excel template initialises slightly differently, causing differences of 1%–15%. Keep the method consistent when comparing.
Classroom Exercise 4

Which Method Fits Each Situation?

Five statements describe five data patterns. Choose the most appropriate method for each.

4.4 Causal Forecasting and Judgemental Forecasting

What Causal Forecasting Is

Time-series forecasting uses only the series’ own history;causal forecasting finds and validates a relationship between independent and dependent variables to forecast future Y. Unlike time-series forecasting, it requires an interpretable driver variable, and that driver must itself be forecast. Unit 3 regression is the tool for causal forecasting.

Variable to forecast (dependent)Driver variable (independent)
Call volumeSales volume
Sales revenueAdvertising and promotion spending
Car salesDisposable household income
Electricity consumptionTemperature and industrial output
Interactive Demonstration 4

Forecast Call Volume from Sales

Use sales as the independent variable and call volume as the dependent variable, fitting a straight line to 10 periods of real data. Enter next period’s sales to obtain a forecast of call volume.

Slope b
Intercept a
R²
Number of periods
Next period’s sales:

Judgemental Forecasting Methods

MethodApproach
Individual manager’s opinionA manager provides a personal best judgement
Management consensusSenior management combines individual judgements into a forecast
Sales-force compositeEach salesperson forecasts their territory, and the forecasts are aggregated
Market researchSurvey existing or potential customers about purchase intentions
Delphi methodExperts complete questionnaires independently; responses are summarised and returned for revision

These methods are especially useful when data are scarce, a new product is launching, or market structure is changing. Their risk is mistaking personal preference for fact, so cross-check them with quantitative methods.

The Consultant’s Advice to CCW

  • Switch forecasting to monthly data, and make hiring and training decisions monthly to avoid large one-off adjustments.
  • For established products, begin with a low smoothing constant in exponential smoothing—demand is stable, so do not overreact to noise.
  • For new products, use a high smoothing constant in exponential smoothing with trend—growth-stage conditions change quickly and the forecast must keep up.
  • All methods should first deseasonalised.
  • forecast by segment and then aggregate, finally using sales regression to obtain call volume.

4.5 Text Data and AI Labelling

This section treats AI as a labelling machine: a large language model converts unstructured reviews into sentiment and topic labels, and human sampling plus an agreement rate determine whether the labels can be used.

Questions That Text Data Can Answer

  • What customers complain about and praise in reviews.
  • How word-of-mouth differs across products.
  • How topic distributions change over time.
  • Text is unstructured data and cannot enter regression directly—first convert it into countable labels.

How LLMs Process Text—and Why They Err

The model splits text into tokens and predicts the probability of each next token. For labelling, it is essentially continuing an answer that follows the required format, so the output looks like a classification even though it remains probabilistic generation:the same question asked twice may produce different labels.

Concrete forms of hallucination
  • Adding details absent from the source
  • Assigning the wrong topic
  • Sentiment inconsistent with context (sarcasm and negation are especially error-prone)
Verification standards
  • Use a fixed prompt and fixed output structure
  • Sample 20 records for human review
  • When agreement is low, first revise the prompt and topic definitions, then decide whether the labels are usable

Six Steps in Text Analysis

StepActionOutput
1 Data preparationAssemble 100–300 reviewsID, text, rating, date and product
2 AI labellingPaste in batches of 20–30ID, sentiment, topic and confidence
3 Human samplingRandomly select 20 records and judge them manuallyHuman labels
4 Calculate agreementCompare AI and human labelsAgreement percentage
5 Excel aggregationUse PivotTables for cross-tabulationSummary tables and charts
6 Discuss limitationsAsk twice on the same data and once more with a changed promptStability findings
AI activity

Labelling prompt template (used consistently)
Role: You are an e-commerce review analyst.
Task: classify each review below by sentiment and topic.
Data: each review’s ID and text.
Output format: return a table with ID, sentiment, topic and confidence; do not explain.
Constraint: sentiment must be Positive, Neutral or Negative; topic must be Quality, Logistics, Price, Customer Service or Other.

Human Sampling and Agreement Rates

Randomly select 20 labelled records and judge them manually again. Compare whether the AI and human labels match for each record:agreement rate = matching records ÷ sampled records. The key issue is not simply the level of agreement, but which topics account for most disagreement—clusters of disagreement indicate unclear definitions or a model weakness.

Interactive Demonstration 5

Agreement and Disagreement Calculator

The 20 records below are the audit sample. After running AI labelling in Excel, enter the AI labels and your own human labels; the page immediately calculates three agreement rates and highlights disagreements.

Sentiment agreement
Topic agreement
Exact agreement
Records completed

Limitations and Pitfalls in Text Analysis

  • Sarcasm and negation are easily misclassified (“Great, it arrived broken”).
  • Industry jargon and abbreviations must be defined in the prompt.
  • A long review may contain more than one topic.
  • Asking twice about the same data may change the conclusion.
  • Thousands of texts exceed chat-mode limits and require an API or programming.
Classroom Exercise 5

Four Judgements about Text Labelling

Using the process and pitfalls above, evaluate the following four statements.

4.6 Summary and Assignment

  • Time-series forecasting first separates trend, seasonal and random components, then extrapolates.
  • After seasonal adjustment, the CCW case’s error can fall from 519.9 to 272.4.
  • No forecasting method is universally best; choose based on data stability, and recognising seasonality matters more than the particular method.
  • Causal forecasting requires an interpretable driver variable, and that driver must itself be forecast.
  • The new text-analysis workflow is AI labelling + human sampling + agreement rate and requires no coding; agreement and stability determine whether the results are usable.
Post-class assignment. Task 1: label sentiment and topic for 100 reviews using the fixed prompt template. Task 2: sample 20 reviews, calculate agreement in Interactive Demonstration 5 and identify disagreement-heavy topics. Task 3: use a PivotTable to create a topic × sentiment cross-tabulation. Assignment: run the labelling again with a different prompt, compare the two results and write a one- to three-sentence AI-use statement.

Appendix: Interactive Demonstrations and Classroom Exercises

LocationTypeContent
4.1DemonstrationCompare four forecasting methods (12-period real series; adjustable n and α)
4.2DemonstrationSeasonal-factor and deseasonalisation workbench (12 CCW quarters)
4.3DemonstrationMAD/MSE comparison and ranking for six methods
4.4DemonstrationCausal forecasting: using sales to forecast call volume
4.5DemonstrationAgreement and disagreement calculator (20 sampled reviews)
4.1ExerciseMAD for four methods
4.2ExerciseCalculate four seasonal factors
4.2ExerciseFour forecasts under the 25% rule
4.3ExerciseChoose methods for five data patterns
4.5ExerciseFour Judgements about Text Labelling

Data sources: CCW.xlsx (12 quarters of daily average call volume), 单元4_时间序列课堂练习.xlsx (12-period sales series), Table 10.41 in Forecasting.xlsx (sales and call volume), and 单元4_评论标注练习_中文.xlsx (100 reviews and 20 sampled records). The review text is simulated course data, not real-platform user reviews.

Unit Glossary (English–Chinese)

English中文
Trend趋势
Seasonality季节性
Seasonal factor季节因子
Moving average移动平均
Exponential smoothing指数平滑
Mean absolute deviation (MAD)平均绝对偏差
Causal forecasting因果预测
Sentiment情感
Agreement rate一致率