Analytics
Predictive Analytics
Time Series Analysis

Time Series Analysis

Time series analysis is a specialized branch of predictive analytics that focuses on modeling and forecasting data points collected sequentially over time. In automotive applications, time series models are essential for sales forecasting, demand planning, and financial projections.

Mathematical Foundation

A time series is a sequence of observations {yt}\{y_t\} indexed by time tt:

Yt=Tt+St+Ct+It\boxed{\mathbf{Y_t = T_t + S_t + C_t + I_t}}

Where:

  • Tt\mathbf{T_t} represents the trend component
  • St\mathbf{S_t} represents the seasonal component
  • Ct\mathbf{C_t} represents the cyclical component
  • It\mathbf{I_t} represents the irregular (random) component

Time Series Components

1. Trend Analysis

The trend represents the long-term direction of the data:

Linear Trend:

Tt=α+βtT_t = \alpha + \beta t

Exponential Trend:

Tt=αeβtT_t = \alpha e^{\beta t}

Polynomial Trend:

Tt=α0+α1t+α2t2++αktkT_t = \alpha_0 + \alpha_1 t + \alpha_2 t^2 + \ldots + \alpha_k t^k

2. Seasonality

Seasonal patterns repeat at fixed intervals (monthly, quarterly, yearly):

Additive Seasonality:

St=j=1sγjDj,tS_t = \sum_{j=1}^{s} \gamma_j D_{j,t}

Multiplicative Seasonality:

St=j=1sγjDj,tS_t = \prod_{j=1}^{s} \gamma_j^{D_{j,t}}

Where Dj,tD_{j,t} are seasonal dummy variables and ss is the seasonal period.

3. Cyclical Patterns

Cyclical components represent longer-term fluctuations without fixed periods:

Ct=Asin(2πft+ϕ)C_t = A \sin(2\pi f t + \phi)

Where AA is amplitude, ff is frequency, and ϕ\phi is phase shift.

ARIMA Models

Autoregressive (AR) Models

An AR(p) model expresses current values as linear combinations of past values:

Yt=ϕ0+i=1pϕiYti+ϵtY_t = \phi_0 + \sum_{i=1}^{p} \phi_i Y_{t-i} + \epsilon_t

Example AR(2) Model:

Yt=ϕ0+ϕ1Yt1+ϕ2Yt2+ϵtY_t = \phi_0 + \phi_1 Y_{t-1} + \phi_2 Y_{t-2} + \epsilon_t

Moving Average (MA) Models

An MA(q) model expresses current values as linear combinations of past error terms:

Yt=μ+i=1qθiϵti+ϵtY_t = \mu + \sum_{i=1}^{q} \theta_i \epsilon_{t-i} + \epsilon_t

ARIMA(p,d,q) Models

ARIMA combines autoregression, differencing, and moving averages:

ϕ(B)(1B)dYt=θ(B)ϵt\phi(B)(1-B)^d Y_t = \theta(B) \epsilon_t

Where:

  • ϕ(B)=1ϕ1Bϕ2B2ϕpBp\phi(B) = 1 - \phi_1 B - \phi_2 B^2 - \ldots - \phi_p B^p (AR polynomial)
  • θ(B)=1+θ1B+θ2B2++θqBq\theta(B) = 1 + \theta_1 B + \theta_2 B^2 + \ldots + \theta_q B^q (MA polynomial)
  • BB is the backshift operator: BYt=Yt1B Y_t = Y_{t-1}
  • dd is the degree of differencing

Automotive Example: Monthly Vehicle Sales Forecasting

Business Context: An automotive manufacturer needs to forecast monthly vehicle sales to optimize production planning and inventory management.

Data Characteristics:

  • Time Series: Monthly sales volume (60 months of historical data)
  • Seasonality: Higher sales in spring/summer, lower in winter
  • Trend: Gradual increase in hybrid vehicle segment
  • External Factors: Economic indicators, gas prices, incentive programs

Model Development Process:

1. Data Preprocessing:

Log Transform: Y~t=log(Yt)\text{Log Transform: } \tilde{Y}_t = \log(Y_t)

2. Stationarity Testing: Augmented Dickey-Fuller test for unit roots:

ΔYt=α+βt+γYt1+i=1pδiΔYti+ϵt\Delta Y_t = \alpha + \beta t + \gamma Y_{t-1} + \sum_{i=1}^{p} \delta_i \Delta Y_{t-i} + \epsilon_t

3. Differencing for Stationarity: First difference: Yt=YtYt1\nabla Y_t = Y_t - Y_{t-1} Seasonal difference: sYt=YtYts\nabla_s Y_t = Y_t - Y_{t-s}

4. Model Identification: Using Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF):

ACF:

rk=t=k+1n(YtYˉ)(YtkYˉ)t=1n(YtYˉ)2r_k = \frac{\sum_{t=k+1}^{n} (Y_t - \bar{Y})(Y_{t-k} - \bar{Y})}{\sum_{t=1}^{n} (Y_t - \bar{Y})^2}

PACF:

ϕkk=Corr(Yt,YtkYt1,Yt2,,Ytk+1)\phi_{kk} = \text{Corr}(Y_t, Y_{t-k} | Y_{t-1}, Y_{t-2}, \ldots, Y_{t-k+1})

5. SARIMA Model Specification: For seasonal data, we use SARIMA(p,d,q)(P,D,Q)_s:

ϕ(B)Φ(Bs)(1B)d(1Bs)DYt=θ(B)Θ(Bs)ϵt\phi(B)\Phi(B^s)(1-B)^d(1-B^s)^D Y_t = \theta(B)\Theta(B^s)\epsilon_t

Example Model: SARIMA(1,1,1)(1,1,1)₁₂:

(1ϕ1B)(1Φ1B12)(1B)(1B12)Yt=(1+θ1B)(1+Θ1B12)ϵt(1-\phi_1 B)(1-\Phi_1 B^{12})(1-B)(1-B^{12})Y_t = (1+\theta_1 B)(1+\Theta_1 B^{12})\epsilon_t

6. Parameter Estimation: Maximum likelihood estimation:

θ^=argmaxθL(θY1,Y2,,Yn)\hat{\boldsymbol{\theta}} = \arg\max_{\boldsymbol{\theta}} L(\boldsymbol{\theta}|Y_1, Y_2, \ldots, Y_n)

Sample Results:

  • ϕ^1=0.65\hat{\phi}_1 = 0.65 (AR coefficient)
  • Φ^1=0.45\hat{\Phi}_1 = 0.45 (Seasonal AR coefficient)
  • θ^1=0.30\hat{\theta}_1 = -0.30 (MA coefficient)
  • Θ^1=0.80\hat{\Theta}_1 = -0.80 (Seasonal MA coefficient)

Forecasting Formula:

Y^T+hT=E[YT+hYT,YT1,,Y1]\hat{Y}_{T+h|T} = E[Y_{T+h}|Y_T, Y_{T-1}, \ldots, Y_1]

Business Application:

  • Production Planning: 6-month sales forecast with 95% confidence intervals
  • Inventory Management: Safety stock calculations based on forecast uncertainty
  • Financial Planning: Revenue projections and cash flow forecasting

Exponential Smoothing

Simple Exponential Smoothing

For data with no trend or seasonality:

Y^t+1=αYt+(1α)Y^t\hat{Y}_{t+1} = \alpha Y_t + (1-\alpha) \hat{Y}_t

Where α\alpha is the smoothing parameter (0<α<1)(0 < \alpha < 1).

Recursive Form:

Y^t+1=αYt+α(1α)Yt1+α(1α)2Yt2+\hat{Y}_{t+1} = \alpha Y_t + \alpha(1-\alpha) Y_{t-1} + \alpha(1-\alpha)^2 Y_{t-2} + \ldots

Holt's Linear Trend Method

For data with trend but no seasonality:

Level Equation:

t=αYt+(1α)(t1+bt1)\ell_t = \alpha Y_t + (1-\alpha)(\ell_{t-1} + b_{t-1})

Trend Equation:

bt=β(tt1)+(1β)bt1b_t = \beta(\ell_t - \ell_{t-1}) + (1-\beta) b_{t-1}

Forecast Equation:

Y^t+h=t+hbt\hat{Y}_{t+h} = \ell_t + h b_t

Holt-Winters Seasonal Method

For data with trend and seasonality:

Level Equation:

t=αYtstm+(1α)(t1+bt1)\ell_t = \alpha \frac{Y_t}{s_{t-m}} + (1-\alpha)(\ell_{t-1} + b_{t-1})

Trend Equation:

bt=β(tt1)+(1β)bt1b_t = \beta(\ell_t - \ell_{t-1}) + (1-\beta) b_{t-1}

Seasonal Equation:

st=γYtt+(1γ)stms_t = \gamma \frac{Y_t}{\ell_t} + (1-\gamma) s_{t-m}

Forecast Equation:

Y^t+h=(t+hbt)st+hm\hat{Y}_{t+h} = (\ell_t + h b_t) s_{t+h-m}

Automotive Example: Dealership Service Revenue Forecasting

Business Context: An automotive dealership needs to forecast monthly service revenue to optimize staffing and parts inventory.

Data Pattern Analysis:

  • Trend: Gradual increase due to aging vehicle population
  • Seasonality: Higher service volume in spring (post-winter maintenance)
  • Cyclical: Economic downturns reduce discretionary maintenance

Holt-Winters Model Application:

Parameter Estimation (using historical data):

  • α=0.3\alpha = 0.3 (level smoothing)
  • β=0.1\beta = 0.1 (trend smoothing)
  • γ=0.2\gamma = 0.2 (seasonal smoothing)

Monthly Forecast Calculation: For month t+1t+1 forecast in January (seasonal index 1.15):

Y^t+1=(t+1bt)×st+112=(45,000+500)×1.15=$52,325\hat{Y}_{t+1} = (\ell_t + 1 \cdot b_t) \times s_{t+1-12} = (45,000 + 500) \times 1.15 = \$52,325

Business Value:

  • Staff Planning: Seasonal hiring based on predicted workload
  • Parts Inventory: Optimal stock levels aligned with service demand
  • Financial Planning: Monthly revenue budgets with confidence intervals

Advanced Time Series Methods

State Space Models

State space representation allows for flexible modeling:

Observation Equation:

Yt=Ztαt+ϵtY_t = Z_t \alpha_t + \epsilon_t

State Equation:

αt+1=Ttαt+Rtηt\alpha_{t+1} = T_t \alpha_t + R_t \eta_t

Where:

  • YtY_t is the observed series
  • αt\alpha_t is the unobserved state vector
  • Zt,Tt,RtZ_t, T_t, R_t are system matrices
  • ϵt,ηt\epsilon_t, \eta_t are error terms

Kalman Filter

The Kalman filter provides optimal state estimates:

Prediction Step:

αtt1=Ttαt1t1\alpha_{t|t-1} = T_t \alpha_{t-1|t-1} Ptt1=TtPt1t1Tt+RtQtRtP_{t|t-1} = T_t P_{t-1|t-1} T_t' + R_t Q_t R_t'

Updating Step:

αtt=αtt1+Kt(YtZtαtt1)\alpha_{t|t} = \alpha_{t|t-1} + K_t (Y_t - Z_t \alpha_{t|t-1})

Where KtK_t is the Kalman gain matrix.

Prophet Model

Prophet decomposes time series into trend, seasonality, and holidays:

y(t)=g(t)+s(t)+h(t)+ϵty(t) = g(t) + s(t) + h(t) + \epsilon_t

Where:

  • g(t)g(t) is the trend function
  • s(t)s(t) represents seasonal effects
  • h(t)h(t) represents holiday effects

Trend Function:

g(t)=(k+a(t)Tδ)t+(m+a(t)Tγ)g(t) = (k + \mathbf{a}(t)^T \boldsymbol{\delta}) t + (m + \mathbf{a}(t)^T \boldsymbol{\gamma})

Automotive Example: Fleet Vehicle Demand Forecasting

Business Context: A car rental company needs to forecast vehicle demand across multiple locations with different seasonal patterns and holiday effects.

Prophet Model Features:

  • Flexible Trend: Handles growth rate changes
  • Multiple Seasonality: Daily, weekly, and yearly patterns
  • Holiday Effects: Special events like auto shows, travel seasons
  • External Regressors: Gas prices, economic indicators

Mathematical Specification:

Demand(t)=Trend(t)+Yearly(t)+Weekly(t)+Holidays(t)+Gas Price Effect(t)+ϵt\text{Demand}(t) = \text{Trend}(t) + \text{Yearly}(t) + \text{Weekly}(t) + \text{Holidays}(t) + \text{Gas Price Effect}(t) + \epsilon_t

Business Results:

  • Accuracy: 15% improvement over traditional methods
  • Interpretability: Clear decomposition of demand drivers
  • Scalability: Automated forecasting for 200+ locations

Model Evaluation and Validation

Forecast Accuracy Metrics

Mean Absolute Error (MAE):

MAE=1hi=1hYT+iY^T+iTMAE = \frac{1}{h} \sum_{i=1}^{h} |Y_{T+i} - \hat{Y}_{T+i|T}|

Mean Absolute Percentage Error (MAPE):

MAPE=100hi=1hYT+iY^T+iTYT+iMAPE = \frac{100}{h} \sum_{i=1}^{h} \left|\frac{Y_{T+i} - \hat{Y}_{T+i|T}}{Y_{T+i}}\right|

Root Mean Squared Error (RMSE):

RMSE=1hi=1h(YT+iY^T+iT)2RMSE = \sqrt{\frac{1}{h} \sum_{i=1}^{h} (Y_{T+i} - \hat{Y}_{T+i|T})^2}

Mean Absolute Scaled Error (MASE):

MASE=MAE1Tmt=m+1TYtYtmMASE = \frac{MAE}{\frac{1}{T-m} \sum_{t=m+1}^{T} |Y_t - Y_{t-m}|}

Cross-Validation for Time Series

Time Series Cross-Validation:

  • Use expanding window or rolling window approaches
  • Maintain temporal order (no random splitting)
  • Test on multiple forecast horizons

Mathematical Framework: For kk folds with minimum training size n0n_0:

CV Error=1ki=1k1hj=1h(YTi+jY^Ti+jTi)2\text{CV Error} = \frac{1}{k} \sum_{i=1}^{k} \frac{1}{h} \sum_{j=1}^{h} (Y_{T_i+j} - \hat{Y}_{T_i+j|T_i})^2

Automotive Industry Applications

Auto Finance

  • Loan Portfolio Performance: Default rate forecasting
  • Interest Rate Modeling: Economic indicator integration
  • Cash Flow Forecasting: Liquidity planning and risk management

Auto Marketing

  • Campaign ROI Prediction: Multi-touch attribution over time
  • Customer Journey Modeling: Conversion probability evolution
  • Brand Sentiment Analysis: Social media trend forecasting

Auto Sales

  • Inventory Turnover: Model-specific demand forecasting
  • Pricing Strategy: Dynamic pricing based on demand patterns
  • Market Share Analysis: Competitive positioning trends

Dealer Financial

  • Parts Demand: Seasonal maintenance pattern forecasting
  • Service Bay Utilization: Capacity planning and optimization
  • Warranty Cost Projection: Actuarial modeling for reserves

Time series analysis provides automotive organizations with the mathematical framework to understand temporal patterns, forecast future outcomes, and make data-driven decisions in dynamic market environments. The combination of classical statistical methods with modern machine learning approaches enables accurate, interpretable, and actionable insights for business planning and operational optimization.