Time Series and Text Data
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
Time-Series Models versus Regression
| Comparison | Regression model | Time-series model |
|---|---|---|
| Source of explanation | Use other variables to explain current Y | Use past values of the same series to predict future values |
| Requirement | Information on independent variables must be available | Relies 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
| Month | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Sales (thousand units) | 17 | 25 | 24 | 26 | 30 | 28 |
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
| Method | Approach | Suitable data |
|---|---|---|
| Naïve method | Use the most recent value as the forecast | Very unstable, with little or no relation between adjacent periods |
| Average method | Use the mean of all historical data | Very stable, with the oldest and newest observations equally representative |
| Moving average | Use the mean of the most recent n periods; the user chooses n | Reasonably stable, with only recent periods relevant to the future |
| Exponential smoothing | Give the newest observation the highest weight, with older observations receiving less | Various stability levels; α controls sensitivity to the newest observation |
| Exponential smoothing with trend | Add a trend estimate to the smoothed level | Clear trend that changes slowly |
| Linear regression | Fit a trend line using time as the independent variable and extrapolate it | Stable-trend series for which time is a meaningful independent variable |
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.
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
| Year | Q1 | Q2 | Q3 | Q4 | Annual average |
|---|---|---|---|---|---|
| Year 1 | 6,809 | 6,465 | 6,569 | 8,266 | 7,529.25 |
| Year 2 | 7,257 | 7,064 | 7,784 | 8,724 | |
| Year 3 | 6,992 | 6,822 | 7,949 | 9,650 | |
| Quarterly average | 7,019.33 | 6,783.67 | 7,434.00 | 8,880.00 | — |
| Seasonal factor | 0.9323 | 0.9010 | 0.9873 | 1.1794 | Total 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.
Three Steps for Forecasting Call Volume
- Choose a time-series forecasting method.
- Apply it to the deseasonalised series to obtain a deseasonalised forecast.
- Multiply the forecast back by the seasonal factor for the corresponding quarter to obtain the final forecast.
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.
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.
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.
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 volume | Sales volume |
| Sales revenue | Advertising and promotion spending |
| Car sales | Disposable household income |
| Electricity consumption | Temperature and industrial output |
Judgemental Forecasting Methods
| Method | Approach |
|---|---|
| Individual manager’s opinion | A manager provides a personal best judgement |
| Management consensus | Senior management combines individual judgements into a forecast |
| Sales-force composite | Each salesperson forecasts their territory, and the forecasts are aggregated |
| Market research | Survey existing or potential customers about purchase intentions |
| Delphi method | Experts 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
| Step | Action | Output |
|---|---|---|
| 1 Data preparation | Assemble 100–300 reviews | ID, text, rating, date and product |
| 2 AI labelling | Paste in batches of 20–30 | ID, sentiment, topic and confidence |
| 3 Human sampling | Randomly select 20 records and judge them manually | Human labels |
| 4 Calculate agreement | Compare AI and human labels | Agreement percentage |
| 5 Excel aggregation | Use PivotTables for cross-tabulation | Summary tables and charts |
| 6 Discuss limitations | Ask twice on the same data and once more with a changed prompt | Stability findings |
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.
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.
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.
Appendix: Interactive Demonstrations and Classroom Exercises
| Location | Type | Content |
|---|---|---|
| 4.1 | Demonstration | Compare four forecasting methods (12-period real series; adjustable n and α) |
| 4.2 | Demonstration | Seasonal-factor and deseasonalisation workbench (12 CCW quarters) |
| 4.3 | Demonstration | MAD/MSE comparison and ranking for six methods |
| 4.4 | Demonstration | Causal forecasting: using sales to forecast call volume |
| 4.5 | Demonstration | Agreement and disagreement calculator (20 sampled reviews) |
| 4.1 | Exercise | MAD for four methods |
| 4.2 | Exercise | Calculate four seasonal factors |
| 4.2 | Exercise | Four forecasts under the 25% rule |
| 4.3 | Exercise | Choose methods for five data patterns |
| 4.5 | Exercise | Four 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 | 一致率 |