---
title: "Short note: Time series, regression"
subject: "Data Mining"
chapter: 7
key: "semester_7/data_mining:time-series-regression-note"
source: https://www.bctengineer.com/q/semester_7/data_mining/time-series-regression-note
site: BCT Engineering
---

# Short note: Time series, regression

Data Mining · Chapter 7: Advanced Applications

- Asked in: year not given
- Video: [What is Time Series l Machine Learning](https://www.youtube.com/watch?v=lcS0jiNoj6o) — 5 Minutes Engineering
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/data_mining/time-series-regression-note
- Whole chapter: https://www.bctengineer.com/md/semester_7/data_mining/chapter-7

## Question

Write a short note on Time series data and regression analysis.

## Short answer

Time series data are ordered values over time with trend, seasonal, cyclic, and irregular components; tasks include forecasting, clustering, and anomaly detection. Regression models a dependent variable from predictors using least squares; for x=1,2,3,4 and y=2,4,5,8, the fitted line is y=1.9x, predicting 9.5 at x=5.

## Answer

#### Time series data
A **time series** is a sequence of data values measured at successive, usually equally spaced, times: daily stock price, monthly rainfall, hourly electricity load, ECG signal. The order of the values matters.

**Components of a time series**
1. **Trend (T)**: long-term increase or decrease.
2. **Seasonal variation (S)**: regular pattern repeating in fixed periods (festival sales).
3. **Cyclic variation (C)**: long-term, non-fixed wave-like movement (business cycles).
4. **Irregular/random variation (I)**: unpredictable noise.
Models: additive Y = T + S + C + I or multiplicative Y = T × S × C × I.

**Mining tasks**: trend analysis (moving average, smoothing), similarity search, forecasting (ARIMA), classification and clustering of series, anomaly detection and sequence/subsequence pattern discovery (e.g. with dynamic time warping).

#### Regression analysis
**Regression** models the relation between a dependent (response) variable *y* and one or more independent (predictor) variables *x*, to predict continuous values.

- **Simple linear regression**: y = w₀ + w₁x, with
  w₁ = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)², w₀ = ȳ − w₁x̄ (least squares: minimises the sum of squared errors).
- **Multiple linear regression**: y = w₀ + w₁x₁ + w₂x₂ + … 
- **Non-linear (polynomial) and logistic regression** (for class prediction).

*Example*: x = 1, 2, 3, 4 and y = 2, 4, 5, 8: x̄ = 2.5, ȳ = 4.75; Σ(xᵢ − x̄)(yᵢ − ȳ) = 9.5 and Σ(xᵢ − x̄)² = 5, so w₁ = 9.5/5 = 1.9, w₀ = 4.75 − 1.9 × 2.5 = 0, giving y = 1.9x. For x = 5 the prediction is 9.5.

Regression is used on time series to fit trends and forecast future values.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does the seasonal component of a time series represent?
   A. A long-term increase or decrease
   B. A regular pattern repeating in fixed periods
   C. Unpredictable noise
   D. A non-fixed long wave
   Answer: B. Seasonal variation repeats in fixed periods, e.g. festival sales. (Key point: Components)

2. How is the multiplicative model written?
   A. Y = T + S + C + I
   B. Y = T x S x C x I
   C. Y = T - S
   D. Y = T / I
   Answer: B. Additive adds the components and multiplicative multiplies them. (Key point: Models)

3. What does least squares regression minimise?
   A. The sum of absolute x values
   B. The sum of squared errors
   C. The number of variables
   D. The mean of y
   Answer: B. The line is chosen to minimise the sum of squared errors. (Key point: Least squares)

4. Given the slope w1, how is w0 found in simple linear regression?
   A. w0 = y-bar - w1 x x-bar
   B. w0 = w1 x x-bar
   C. w0 = x-bar - y-bar
   D. w0 = w1 / x-bar
   Answer: A. The line passes through the means, so w0 = y-bar - w1 x-bar. (Key point: Intercept)

## Related in Data Mining

- [Association analysis and Apriori pruning](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aassociation-apriori-pruning) — Data Mining, chapter 4, asked 2×
- [Cluster analysis; K-means on height/width](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Akmeans-height-width) — Data Mining, chapter 5
- [Cluster analysis applications; K-means](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Acluster-application-kmeans) — Data Mining, chapter 5

## Related in other subjects

- [Derive the discrete-time Fourier series](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adtfs-derivation) — Signals and Systems, chapter 2, asked 15×
- [Properties of continuous-time Fourier series](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Afourier-series-properties) — Data Communication, chapter 3
- [Data required for rate analysis (building)](https://www.bctengineer.com/question.md?key=semester_7%2Festimating_and_costing%3Arate-analysis-data-required) — Estimating and Costing, chapter 4
- [Real-time versus ordinary software and OS; data acquisition](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Areal-time-vs-non-real-time) — Software Engineering, chapter 4
