Demand Forecasting



Mathematical Formula & Modeling

The transformation of a datetime:


1. Mathematical Representation

Let T be the target timestamp and torigin be the reference point. The value in decimal days D is defined as:

D = fsec(T - torigin) 86,400

Where:

  • fsec: A function that extracts the total accumulated seconds from a time duration.
  • 86,400: The constant for total seconds in a day (24 hours × 3,600 seconds).
  • D: A continuous scalar in ℝ (Real Numbers).

2. Logical Modeling Process

In data modeling, this transformation follows a Linear Temporal Scaling logic:

Stage Operation Result Type
Translation (T - torigin) Timedelta Object
Quantification .total_seconds() Integer/Float (Seconds)
Normalization / 86,400 Normalized Float (Days)


  1. Công thức tổng quát:

    y =
    f(x) Quy luật (Signal)
    +
    ε Sai số (Noise)
  1. Constant:
    K(x, x') = σ₀²



  2. Thời gian tuyến tính theo ngày:

Exponential function: exp(x) = e ^x

Trong đó:
- e là số Euler, một hằng số toán học xấp xỉ bằng 2,71828

- x là số mũ bạn đưa vào.


Mô tả: 

- Hôm nay và hôm qua (hoặc cách đây n ngày) có liên quan gì nhau không. Ví dụ: Nếu ngày 01/02 kho rất đông khách, thì ngày 02/02 khả năng cao vẫn sẽ đông vì các chương trình khuyến mãi thường kéo dài vài ngày.

f = | x - x’|



Ý nghĩa: Giúp mô hình bắt được xu hướng ngắn hạn (ví dụ: một đợt cao điểm mua sắm kéo dài 1 tuần).

2. Ngày trong tuần" (Tính chu kỳ): 







Decomposition of Multi-Component Gaussian Process Regression for Logistics Demand Forecasting

  1. Overview:

The charts illustrate the daily pickup and delivery weights across three key regions: Ho Chi Minh City (HCMC), Hanoi, and Binh Thuan. A shared characteristic across all regions is a significant, sharp decline in volume during late January and early February 2025, which aligns with the Lunar New Year (Tet) holiday period.





  • Ho Chi Minh City & Hanoi: High-Volume Hubs:

  • In both cities, pickup weight (Khối lượng lấy) consistently exceeds delivery weight (Khối lượng giao). This suggests these cities act as major distribution points or manufacturing origins.

  • Both regions show high daily volatility, with HCMC peaking near 1.5 x 10^9 kg in September and Hanoi reaching its highest peak of approximately $1.6 x 10^9 kg in December

  • There is a visible upward trend in activity toward the end of the year (Q4), likely driven by shopping festivals and holiday demand.

Figure 1. Comparison of delivery and pickup weights across Ho Chi Minh City, Hanoi.

  • Binh Thuan: The Outlier Profile:

  • The volume in Binh Thuan is significantly lower, measured in tens of millions (10^7 kg) rather than billions.

  • Unlike HCMC and Hanoi, Binh Thuan's delivery weight (Khối lượng giao) far exceeds its pickup weight (Khối lượng lấy) throughout the year. This identifies Binh Thuan primarily as a "destination region" rather than a "source region."

Figure 2. Regional weight breakdown for delivery and pickup services of Binh Thuan Province

  1. Logistics Demand Analysis Factors


Factors

Description

Temporal Dimensions

Variables: Time and Hour


These detailed temporal elements allow for the analysis of long-term trends and seasonality patterns across daily, weekly, monthly, or yearly scales.


Specific events occurring at the hourly or daily level can significantly influence logistics demand.

Spatial Dimensions

Variables: Warehouse Code, Province, Region, and Region Code


These geographical factors indicate that logistics demand varies substantially based on location.


Certain regions may exhibit higher demand density or distinct growth trajectories compared to others.

Demand Metrics

Variables: Pickup Weight and Delivery Weight


These serve as the primary target variables for forecasting models.


Each metric possesses unique characteristics and behaviors that require specific modeling approaches.

Table 1. 



  1. Methodology

Ktotal

=

(KDPl +KESS +KRBF ) + KWhite


Figure 2. Composite Kernel Architecture


ConstantKernel: Xác định mức trung bình của dữ liệu:

KDPl

DotProduct Kernel: Models the long-term structural growth or decline in demand (linear trend).


Xu hướng tuyến tính (tăng hoặc giảm theo thời gian)



KESS

ExpSineSquared Kernel

KRBF

RBF Kernel

KWhite

WhiteKernel



References:
Gaussian Processes for Machine Learning: Contents. (n.d.). https://gaussianprocess.org/gpml/chapters/
thienhang.com