Merge branch 'release-0.1.0' into main
This commit is contained in:
commit
1184c54377
52 changed files with 6042 additions and 1 deletions
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
*.acn
|
||||||
|
*.acr
|
||||||
|
*.alg
|
||||||
|
*.aux
|
||||||
|
*.bbl
|
||||||
|
*.blg
|
||||||
|
*.glg
|
||||||
|
*.glo
|
||||||
|
*.gls
|
||||||
|
*.glsdefs
|
||||||
|
*.ist
|
||||||
|
*.log
|
||||||
|
*.spl
|
||||||
|
*.synctex.gz
|
||||||
|
|
@ -6,5 +6,5 @@ to generate the academic paper
|
||||||
based on the
|
based on the
|
||||||
[urban-meal-delivery](https://github.com/webartifex/urban-meal-delivery)
|
[urban-meal-delivery](https://github.com/webartifex/urban-meal-delivery)
|
||||||
research project.
|
research project.
|
||||||
The paper was submitted to and is currently under review by the journal
|
The paper is accepted for publication by the journal
|
||||||
[Transportation Research Part E: Logistics and Transportation Review](https://www.journals.elsevier.com/transportation-research-part-e-logistics-and-transportation-review).
|
[Transportation Research Part E: Logistics and Transportation Review](https://www.journals.elsevier.com/transportation-research-part-e-logistics-and-transportation-review).
|
||||||
|
|
|
||||||
BIN
paper.pdf
Normal file
BIN
paper.pdf
Normal file
Binary file not shown.
61
paper.tex
Normal file
61
paper.tex
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
\documentclass[preprint,review,12pt,authoryear]{static/elsarticle}
|
||||||
|
|
||||||
|
\input{tex/preamble}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\input{tex/meta}
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\input{tex/1_intro}
|
||||||
|
\input{tex/2_lit/1_intro}
|
||||||
|
\input{tex/2_lit/2_class/1_intro}
|
||||||
|
\input{tex/2_lit/2_class/2_ets}
|
||||||
|
\input{tex/2_lit/2_class/3_arima}
|
||||||
|
\input{tex/2_lit/2_class/4_stl}
|
||||||
|
\input{tex/2_lit/3_ml/1_intro}
|
||||||
|
\input{tex/2_lit/3_ml/2_learning}
|
||||||
|
\input{tex/2_lit/3_ml/3_cv}
|
||||||
|
\input{tex/2_lit/3_ml/4_rf}
|
||||||
|
\input{tex/2_lit/3_ml/5_svm}
|
||||||
|
\input{tex/3_mod/1_intro}
|
||||||
|
\input{tex/3_mod/2_overall}
|
||||||
|
\input{tex/3_mod/3_grid}
|
||||||
|
\input{tex/3_mod/4_cv}
|
||||||
|
\input{tex/3_mod/5_mase}
|
||||||
|
\input{tex/3_mod/6_decomp}
|
||||||
|
\input{tex/3_mod/7_models/1_intro}
|
||||||
|
\input{tex/3_mod/7_models/2_hori}
|
||||||
|
\input{tex/3_mod/7_models/3_vert}
|
||||||
|
\input{tex/3_mod/7_models/4_rt}
|
||||||
|
\input{tex/3_mod/7_models/5_ml}
|
||||||
|
\input{tex/4_stu/1_intro}
|
||||||
|
\input{tex/4_stu/2_data}
|
||||||
|
\input{tex/4_stu/3_params}
|
||||||
|
\input{tex/4_stu/4_overall}
|
||||||
|
\input{tex/4_stu/5_training}
|
||||||
|
\input{tex/4_stu/6_fams}
|
||||||
|
\input{tex/4_stu/7_pixels_intervals}
|
||||||
|
\input{tex/5_con/1_intro}
|
||||||
|
\input{tex/5_con/2_generalizability}
|
||||||
|
\input{tex/5_con/3_implications}
|
||||||
|
\input{tex/5_con/4_further_research}
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\appendix
|
||||||
|
\newpage
|
||||||
|
\input{tex/apx/tabular_ml_models}
|
||||||
|
\newpage
|
||||||
|
\input{tex/apx/enhanced_feats}
|
||||||
|
\newpage
|
||||||
|
\input{tex/apx/case_study}
|
||||||
|
\newpage
|
||||||
|
\input{tex/apx/peak_results}
|
||||||
|
\newpage
|
||||||
|
\input{tex/apx/glossary}
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\bibliographystyle{static/elsarticle-harv}
|
||||||
|
\bibliography{tex/references}
|
||||||
|
|
||||||
|
\end{document}
|
||||||
BIN
static/cross_validation_gray.png
Normal file
BIN
static/cross_validation_gray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
1597
static/elsarticle-harv.bst
Normal file
1597
static/elsarticle-harv.bst
Normal file
File diff suppressed because it is too large
Load diff
1056
static/elsarticle.cls
Normal file
1056
static/elsarticle.cls
Normal file
File diff suppressed because it is too large
Load diff
BIN
static/gridification_for_paris_gray.png
Normal file
BIN
static/gridification_for_paris_gray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 261 KiB |
BIN
static/model_inputs_gray.png
Normal file
BIN
static/model_inputs_gray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
77
static/slashbox.sty
Normal file
77
static/slashbox.sty
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
% slashbox.sty by Koichi Yasuoka, May 27, 1993
|
||||||
|
% minor modification by Toru Sato, May 31, 1993
|
||||||
|
\typeout{slashbox style by K.Yasuoka, May 1993.}%
|
||||||
|
\newbox\@slashboxa
|
||||||
|
\newbox\@slashboxb
|
||||||
|
\newbox\@slashboxc
|
||||||
|
\newcount\@slashboxwd
|
||||||
|
\newcount\@slashboxht
|
||||||
|
\newdimen\@slashsepl
|
||||||
|
\newdimen\@slashsepr
|
||||||
|
\def\slashbox{%
|
||||||
|
\def\@slashboxpicture##1{%
|
||||||
|
\put(0,0){\line(##1,1){\@slashboxwd}}%
|
||||||
|
\put(0,\@slashboxht){\makebox(0,0)[tl]{\box\@slashboxa}}%
|
||||||
|
\put(\@slashboxwd,0){\makebox(0,0)[br]{\box\@slashboxb}}%
|
||||||
|
}%
|
||||||
|
\@slashbox
|
||||||
|
}%
|
||||||
|
\def\backslashbox{%
|
||||||
|
\def\@slashboxpicture##1{%
|
||||||
|
\put(0,\@slashboxht){\line(##1,-1){\@slashboxwd}}%
|
||||||
|
\put(0,0){\makebox(0,0)[bl]{\box\@slashboxa}}%
|
||||||
|
\put(\@slashboxwd,\@slashboxht){\makebox(0,0)[tr]{\box\@slashboxb}}%
|
||||||
|
}%
|
||||||
|
\@slashbox
|
||||||
|
}%
|
||||||
|
\def\@slashbox{\@ifnextchar [{\@@slashbox}{\@@slashbox[0pt]}}
|
||||||
|
\def\@@slashbox[#1]{\@ifnextchar [{\@@@slashbox[#1]}{\@@@slashbox[#1][c]}}
|
||||||
|
\def\@@@slashbox[#1][#2]#3#4{%
|
||||||
|
% #1: width, #2: suppression of \tabcolsep on `l', `r', or `lr' side
|
||||||
|
% #3: left item, #4: right item
|
||||||
|
\@slashsepl=\tabcolsep
|
||||||
|
\@slashsepr=\tabcolsep
|
||||||
|
\@tfor\@tempa :=#2\do{\expandafter\let
|
||||||
|
\csname @slashsep\@tempa\endcsname=\z@}%
|
||||||
|
\setbox\@slashboxa=\hbox{\strut\hskip\tabcolsep\shortstack[l]{#3}}%
|
||||||
|
\setbox\@slashboxb=\hbox{\shortstack[r]{#4}\hskip\tabcolsep\strut}%
|
||||||
|
\setbox\@slashboxa=\hbox{\raise\dp\@slashboxa\box\@slashboxa}%
|
||||||
|
\setbox\@slashboxb=\hbox{\raise\dp\@slashboxb\box\@slashboxb}%
|
||||||
|
\setbox\@slashboxc=\hbox{%
|
||||||
|
\@tempdima=\wd\@slashboxa
|
||||||
|
\advance\@tempdima by \wd\@slashboxb
|
||||||
|
\advance\@tempdima by \@slashsepl
|
||||||
|
\advance\@tempdima by \@slashsepr
|
||||||
|
\@tempdimb=#1\relax%
|
||||||
|
\ifdim\@tempdimb>\@tempdima \@tempdima=\@tempdimb\fi%
|
||||||
|
\@tempdimb=\ht\@slashboxa
|
||||||
|
\advance\@tempdimb by \dp\@slashboxa
|
||||||
|
\advance\@tempdimb by \ht\@slashboxb
|
||||||
|
\advance\@tempdimb by \dp\@slashboxb
|
||||||
|
\@tempcnta=\@tempdima
|
||||||
|
\@tempcntb=\@tempdimb
|
||||||
|
\advance\@tempcnta by \@tempcntb
|
||||||
|
\advance\@tempcnta by -1
|
||||||
|
\divide\@tempcnta by \@tempcntb
|
||||||
|
\ifnum\@tempcnta>6 \@tempcnta=6
|
||||||
|
\@tempdimb=0.166666666\@tempdima
|
||||||
|
\else
|
||||||
|
\ifnum\@tempcnta<1 \@tempcnta=1\fi
|
||||||
|
\@tempdima=\@tempdimb
|
||||||
|
\multiply\@tempdima by \@tempcnta
|
||||||
|
\fi%
|
||||||
|
\advance\@tempdima by -\@slashsepl
|
||||||
|
\advance\@tempdima by -\@slashsepr
|
||||||
|
\@slashboxwd=\@tempdima
|
||||||
|
\@slashboxht=\@tempdimb
|
||||||
|
\@tempcntb=\@slashsepl
|
||||||
|
\setlength{\unitlength}{1sp}%
|
||||||
|
\begin{picture}(\@slashboxwd,\@slashboxht)(\@tempcntb,0)
|
||||||
|
\advance\@tempdima by \@slashsepl
|
||||||
|
\advance\@tempdima by \@slashsepr
|
||||||
|
\@slashboxwd=\@tempdima
|
||||||
|
\@slashboxpicture{\@tempcnta}
|
||||||
|
\end{picture}%
|
||||||
|
}%
|
||||||
|
$\vcenter{\box\@slashboxc}$%
|
||||||
|
}%
|
||||||
BIN
static/stl_gray.png
Normal file
BIN
static/stl_gray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
103
tex/1_intro.tex
Normal file
103
tex/1_intro.tex
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
\section{Introduction}
|
||||||
|
\label{intro}
|
||||||
|
|
||||||
|
In recent years, many meal delivery platform providers (e.g., Uber Eats,
|
||||||
|
GrubHub, DoorDash, Deliveroo) with different kinds of business models have
|
||||||
|
entered the markets in cities around the world.
|
||||||
|
A study by \cite{hirschberg2016} estimates the global market size to surpass
|
||||||
|
20 billion Dollars by 2025.
|
||||||
|
A common feature of these platforms is that they do not operate kitchens but
|
||||||
|
focus on marketing their partner restaurants' meals, unifying all order
|
||||||
|
related processes in simple smartphone apps, and managing the delivery via
|
||||||
|
a fleet of either employees or crowd-sourced sub-contractors.
|
||||||
|
|
||||||
|
Various kinds of urban delivery platforms
|
||||||
|
(\gls{udp}; \ref{glossary} provides a glossary with all abbreviations)
|
||||||
|
have received attention in recent scholarly publications.
|
||||||
|
\cite{hou2018} look into heuristics to simultaneously optimize courier
|
||||||
|
scheduling and routing in general, while \cite{masmoudi2018} do so
|
||||||
|
for the popular dial-a-ride problem and \cite{wang2018} investigate
|
||||||
|
the effect of different fulfillment strategies in the context of urban
|
||||||
|
meal delivery.
|
||||||
|
\cite{ehmke2018} and \cite{alcaraz2019} focus their research on the routing
|
||||||
|
aspect, which is commonly modeled as a so-called vehicle routing problem
|
||||||
|
(\gls{vrp}).
|
||||||
|
|
||||||
|
Not covered in the recent literature is research focusing on the demand
|
||||||
|
forecasting problem a UDP faces.
|
||||||
|
Due to the customers' fragmented locations and the majority of the orders
|
||||||
|
occurring ad-hoc for immediate delivery in the case of a meal delivery
|
||||||
|
platform, forecasting demand for the near future (i.e., several hours)
|
||||||
|
and distinct locations of the city in real-time is an essential factor
|
||||||
|
in achieving timely fulfillment.
|
||||||
|
In general, demand forecasting is a well-researched discipline with a
|
||||||
|
decades-long history in scholarly journals as summarized, for example, by
|
||||||
|
\cite{de2006}.
|
||||||
|
Even some meal delivery platforms themselves publish their practices: For
|
||||||
|
example, \cite{bell2018} provide a general overview of supply and demand
|
||||||
|
forecasting at Uber and benchmarks of the methods used while
|
||||||
|
\cite{laptev2017} investigate how extreme events can be incorporated.
|
||||||
|
|
||||||
|
The conditions such platforms face are not limited to meal delivery:
|
||||||
|
Any entity that performs ad-hoc requested point-to-point transportation at
|
||||||
|
scale in an urban area benefits from a robust forecasting system.
|
||||||
|
Examples include ride-hailing, such as the original Uber offering, or bicycle
|
||||||
|
courier services.
|
||||||
|
The common characteristics are:
|
||||||
|
\begin{itemize}
|
||||||
|
\item \textbf{Geospatial Slicing}:
|
||||||
|
Forecasts for distinct parts of a city in parallel
|
||||||
|
\item \textbf{Temporal Slicing}:
|
||||||
|
Forecasts on a sub-daily basis (e.g., 60-minute windows)
|
||||||
|
\item \textbf{Order Sparsity}:
|
||||||
|
The historical order time series exhibit an intermittent pattern
|
||||||
|
\item \textbf{Double Seasonality}:
|
||||||
|
Demand varies with the day of the week and the time of day
|
||||||
|
\end{itemize}
|
||||||
|
Whereas the first two points can be assumed to vary with the concrete
|
||||||
|
application's requirements, it is the last two that pose challenges for
|
||||||
|
forecasting a platform's demand:
|
||||||
|
Intermittent demand (i.e., many observations in the historic order time series
|
||||||
|
exhibit no demand at all) renders most of the commonly applied error
|
||||||
|
metrics useless.
|
||||||
|
Moreover, many of the established forecasting methods can only handle a single
|
||||||
|
and often low seasonality (i.e., repeated regular pattern), if at all.
|
||||||
|
|
||||||
|
In this paper, we develop a rigorous methodology as to how to build and
|
||||||
|
evaluate a robust forecasting system for an UDP
|
||||||
|
that offers ad-hoc point-to-point transportation of any kind.
|
||||||
|
We implement such a system with a broad set of commonly used forecasting
|
||||||
|
methods.
|
||||||
|
We not only apply established (i.e., "classical") time series methods but also
|
||||||
|
machine learning (\gls{ml}) models that have gained traction in recent
|
||||||
|
years due to advancements in computing power and availability of larger
|
||||||
|
amounts of data.
|
||||||
|
In that regard, the classical methods serve as benchmarks for the ML methods.
|
||||||
|
Our system is trained on and evaluated with a dataset obtained from an
|
||||||
|
undisclosed industry partner that, during the timeframe of our study, was
|
||||||
|
active in several European countries and, in particular, in France.
|
||||||
|
Its primary business strategy is the delivery of meals from upper-class
|
||||||
|
restaurants to customers in their home or work places via bicycles.
|
||||||
|
In this empirical study, we identify the best-performing methods.
|
||||||
|
Thus, we answer the following research questions:
|
||||||
|
\begin{enumerate}
|
||||||
|
\item[\textbf{Q1}:]
|
||||||
|
Which forecasting methods work best under what circumstances?
|
||||||
|
\item[\textbf{Q2}:]
|
||||||
|
How do classical forecasting methods compare with ML models?
|
||||||
|
\item[\textbf{Q3}:]
|
||||||
|
How does the forecast accuracy change with more historic data available?
|
||||||
|
\item[\textbf{Q4}:]
|
||||||
|
Can real-time information on demand be exploited?
|
||||||
|
\item[\textbf{Q5}:]
|
||||||
|
Can external data (e.g., weather data) improve the forecast accuracy?
|
||||||
|
\end{enumerate}
|
||||||
|
To the best of our knowledge, no such study has yet been published in a
|
||||||
|
scholarly journal.
|
||||||
|
|
||||||
|
The subsequent Section \ref{lit} reviews the literature on the forecasting
|
||||||
|
methods included in the system.
|
||||||
|
Section \ref{mod} introduces our forecasting system, and Section \ref{stu}
|
||||||
|
discusses the results obtained in the empirical study.
|
||||||
|
Lastly, Section \ref{con} summarizes our findings and concludes
|
||||||
|
with an outlook on further research opportunities.
|
||||||
17
tex/2_lit/1_intro.tex
Normal file
17
tex/2_lit/1_intro.tex
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
\section{Literature Review}
|
||||||
|
\label{lit}
|
||||||
|
|
||||||
|
In this section, we review the specific forecasting methods that make up our
|
||||||
|
forecasting system.
|
||||||
|
We group them into classical statistics and ML models.
|
||||||
|
The two groups differ mainly in how they represent the input data and how
|
||||||
|
accuracy is evaluated.
|
||||||
|
|
||||||
|
A time series is a finite and ordered sequence of equally spaced observations.
|
||||||
|
Thus, time is regarded as discrete and a time step as a short period.
|
||||||
|
Formally, a time series $Y$ is defined as $Y = \{y_t: t \in I\}$, or $y_t$ for
|
||||||
|
short, where $I$ is an index set of positive integers.
|
||||||
|
Besides its length $T = |Y|$, another property is the a priori fixed and
|
||||||
|
non-negative periodicity $k$ of a seasonal pattern in demand:
|
||||||
|
$k$ is the number of time steps after which a pattern repeats itself (e.g.,
|
||||||
|
$k=12$ for monthly sales data).
|
||||||
13
tex/2_lit/2_class/1_intro.tex
Normal file
13
tex/2_lit/2_class/1_intro.tex
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
\subsection{Demand Forecasting with Classical Forecasting Methods}
|
||||||
|
\label{class_methods}
|
||||||
|
|
||||||
|
Forecasting became a formal discipline starting in the 1950s and has its
|
||||||
|
origins in the broader field of statistics.
|
||||||
|
\cite{hyndman2018} provide a thorough overview of the concepts and methods
|
||||||
|
established, and \cite{ord2017} indicate business-related applications
|
||||||
|
such as demand forecasting.
|
||||||
|
These "classical" forecasting methods share the characteristic that they are
|
||||||
|
trained over the entire $Y$ first.
|
||||||
|
Then, for prediction, the forecaster specifies the number of time steps for
|
||||||
|
which he wants to generate forecasts.
|
||||||
|
That is different for ML models.
|
||||||
78
tex/2_lit/2_class/2_ets.tex
Normal file
78
tex/2_lit/2_class/2_ets.tex
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
\subsubsection{Na\"{i}ve Methods, Moving Averages, and Exponential Smoothing}
|
||||||
|
\label{ets}
|
||||||
|
|
||||||
|
Simple forecasting methods are often employed as a benchmark for more
|
||||||
|
sophisticated ones.
|
||||||
|
The so-called na\"{i}ve and seasonal na\"{i}ve methods forecast the next time
|
||||||
|
step in a time series, $y_{T+1}$, with the last observation, $y_T$,
|
||||||
|
and, if a seasonal pattern is present, with the observation $k$ steps
|
||||||
|
before, $y_{T+1-k}$.
|
||||||
|
As variants, both methods can be generalized to include drift terms in the
|
||||||
|
presence of a trend or changing seasonal amplitude.
|
||||||
|
|
||||||
|
If a time series exhibits no trend, a simple moving average (SMA) is a
|
||||||
|
generalization of the na\"{i}ve method that is more robust to outliers.
|
||||||
|
It is defined as follows: $\hat{y}_{T+1} = \frac{1}{h} \sum_{i=T-h}^{T} y_i$
|
||||||
|
where $h$ is the horizon over which the average is calculated.
|
||||||
|
If a time series exhibits a seasonal pattern, setting $h$ to a multiple of the
|
||||||
|
periodicity $k$ suffices that the forecast is unbiased.
|
||||||
|
|
||||||
|
Starting in the 1950s, another popular family of forecasting methods,
|
||||||
|
so-called exponential smoothing methods, was introduced by
|
||||||
|
\cite{brown1959}, \cite{holt1957}, and \cite{winters1960}.
|
||||||
|
The idea is that forecasts $\hat{y}_{T+1}$ are a weighted average of past
|
||||||
|
observations where the weights decay over time; in the case of the simple
|
||||||
|
exponential smoothing (SES) method we obtain:
|
||||||
|
$
|
||||||
|
\hat{y}_{T+1} = \alpha y_T + \alpha (1 - \alpha) y_{T-1}
|
||||||
|
+ \alpha (1 - \alpha)^2 y_{T-2}
|
||||||
|
+ \dots + \alpha (1 - \alpha)^{T-1} y_{1}
|
||||||
|
$
|
||||||
|
where $\alpha$ (with $0 \le \alpha \le 1$) is a smoothing parameter.
|
||||||
|
|
||||||
|
Exponential smoothing methods are often expressed in an alternative component
|
||||||
|
form that consists of a forecast equation and one or more smoothing
|
||||||
|
equations for unobservable components.
|
||||||
|
Below, we present a generalization of SES, the so-called Holt-Winters'
|
||||||
|
seasonal method, in an additive formulation.
|
||||||
|
$\ell_t$, $b_t$, and $s_t$ represent the unobservable level, trend, and
|
||||||
|
seasonal components inherent in $y_t$, and $\beta$ and $\gamma$ complement
|
||||||
|
$\alpha$ as smoothing parameters:
|
||||||
|
\begin{align*}
|
||||||
|
\hat{y}_{t+1} & = \ell_t + b_t + s_{t+1-k} \\
|
||||||
|
\ell_t & = \alpha(y_t - s_{t-k}) + (1 - \alpha)(\ell_{t-1} + b_{t-1}) \\
|
||||||
|
b_t & = \beta (\ell_{t} - \ell_{t-1}) + (1 - \beta) b_{t-1} \\
|
||||||
|
s_t & = \gamma (y_t - \ell_{t-1} - b_{t-1}) + (1-\gamma)s_{t-k}
|
||||||
|
\end{align*}
|
||||||
|
With $b_t$, $s_t$, $\beta$, and $\gamma$ removed, this formulation reduces to
|
||||||
|
SES.
|
||||||
|
Distinct variations exist: Besides the three components, \cite{gardner1985}
|
||||||
|
add dampening for the trend, \cite{pegels1969} provides multiplicative
|
||||||
|
formulations, and \cite{taylor2003} adds dampening to the latter.
|
||||||
|
The accuracy measure commonly employed is the sum of squared errors between
|
||||||
|
the observations and their forecasts.
|
||||||
|
|
||||||
|
Originally introduced by \cite{assimakopoulos2000}, \cite{hyndman2003} show
|
||||||
|
how the Theta method can be regarded as an equivalent to SES with a drift
|
||||||
|
term.
|
||||||
|
We mention this method here only because \cite{bell2018} emphasize that it
|
||||||
|
performs well at Uber.
|
||||||
|
However, in our empirical study, we find that this is not true in general.
|
||||||
|
|
||||||
|
\cite{hyndman2002} introduce statistical processes, so-called innovations
|
||||||
|
state-space models, to generalize the methods in this sub-section.
|
||||||
|
They call this family of models ETS as they capture error, trend, and seasonal
|
||||||
|
terms.
|
||||||
|
Linear and additive ETS models have a structure like so:
|
||||||
|
\begin{align*}
|
||||||
|
y_t & = \vec{w} \cdot \vec{x}_{t-1} + \epsilon_t \\
|
||||||
|
\vec{x_t} & = \mat{F} \vec{x}_{t-1} + \vec{g} \epsilon_t
|
||||||
|
\end{align*}
|
||||||
|
$y_t$ denote the observations as before while $\vec{x}_t$ is a state vector of
|
||||||
|
unobserved components.
|
||||||
|
$\epsilon_t$ is a white noise series and the matrix $\mat{F}$ and the vectors
|
||||||
|
$\vec{g}$ and $\vec{w}$ contain a model's coefficients.
|
||||||
|
Just as the models in the next sub-section, ETS models are commonly fitted
|
||||||
|
with maximum likelihood and evaluated using information theoretical
|
||||||
|
criteria against historical data.
|
||||||
|
We refer to \cite{hyndman2008b} for a thorough summary.
|
||||||
69
tex/2_lit/2_class/3_arima.tex
Normal file
69
tex/2_lit/2_class/3_arima.tex
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
\subsubsection{Autoregressive Integrated Moving Averages}
|
||||||
|
\label{arima}
|
||||||
|
|
||||||
|
\cite{box1962}, \cite{box1968}, and more papers by the same authors in the
|
||||||
|
1960s introduce a type of model where observations correlate with their
|
||||||
|
neighbors and refer to them as autoregressive integrated moving average
|
||||||
|
(ARIMA) models for stationary time series.
|
||||||
|
For a thorough overview, we refer to \cite{box2015} and \cite{brockwell2016}.
|
||||||
|
|
||||||
|
A time series $y_t$ is stationary if its moments are independent of the
|
||||||
|
point in time where it is observed.
|
||||||
|
A typical example is a white noise $\epsilon_t$ series.
|
||||||
|
Therefore, a trend or seasonality implies non-stationarity.
|
||||||
|
\cite{kwiatkowski1992} provide a test to check the null hypothesis of
|
||||||
|
stationary data.
|
||||||
|
To obtain a stationary time series, one chooses from several techniques:
|
||||||
|
First, to stabilize a changing variance (i.e., heteroscedasticity), one
|
||||||
|
applies a Box-Cox transformation (e.g., $log$) as first suggested by
|
||||||
|
\cite{box1964}.
|
||||||
|
Second, to factor out a trend (or seasonal) pattern, one computes differences
|
||||||
|
of consecutive (or of lag $k$) observations or even differences thereof.
|
||||||
|
Third, it is also common to pre-process $y_t$ with one of the decomposition
|
||||||
|
methods mentioned in Sub-section \ref{stl} below with an ARIMA model
|
||||||
|
then trained on an adjusted $y_t$.
|
||||||
|
|
||||||
|
In the autoregressive part, observations are modeled as linear combinations of
|
||||||
|
its predecessors.
|
||||||
|
Formally, an $AR(p)$ model is defined with a drift term $c$, coefficients
|
||||||
|
$\phi_i$ to be estimated (where $i$ is an index with $0 < i \leq p$), and
|
||||||
|
white noise $\epsilon_t$ like so:
|
||||||
|
$
|
||||||
|
AR(p): \ \
|
||||||
|
y_t = c + \phi_1 y_{t-1} + \phi_2 y_{t-2} + \dots + \phi_p y_{t-p}
|
||||||
|
+ \epsilon_t
|
||||||
|
$.
|
||||||
|
The moving average part considers observations to be regressing towards a
|
||||||
|
linear combination of past forecasting errors.
|
||||||
|
Formally, a $MA(q)$ model is defined with a drift term $c$, coefficients
|
||||||
|
$\theta_j$ to be estimated, and white noise terms $\epsilon_t$ (where $j$
|
||||||
|
is an index with $0 < j \leq q$) as follows:
|
||||||
|
$
|
||||||
|
MA(q): \ \
|
||||||
|
y_t = c + \epsilon_t + \theta_1 \epsilon_{t-1} + \theta_2 \epsilon_{t-2}
|
||||||
|
+ \dots + \theta_q \epsilon_{t-q}
|
||||||
|
$.
|
||||||
|
Finally, an $ARIMA(p,d,q)$ model unifies both parts and adds differencing
|
||||||
|
where $d$ is the degree of differences and the $'$ indicates differenced
|
||||||
|
values:
|
||||||
|
$
|
||||||
|
ARIMA(p,d,q): \ \
|
||||||
|
y'_t = c + \phi_1 y'_{t-1} + \dots + \phi_p y'_{t-p} + \theta_1 \epsilon_{t-1}
|
||||||
|
+ \dots + \theta_q \epsilon_{t-q} + \epsilon_{t}
|
||||||
|
$.
|
||||||
|
|
||||||
|
$ARIMA(p,d,q)$ models are commonly fitted with maximum likelihood estimation.
|
||||||
|
To find an optimal combination of the parameters $p$, $d$, and $q$, the
|
||||||
|
literature suggests calculating an information theoretical criterion
|
||||||
|
(e.g., Akaike's Information Criterion) that evaluates the fit on
|
||||||
|
historical data.
|
||||||
|
\cite{hyndman2008a} provide a step-wise heuristic to choose $p$, $d$, and $q$,
|
||||||
|
that also decides if a Box-Cox transformation is to be applied, and if so,
|
||||||
|
which one.
|
||||||
|
To obtain a one-step-ahead forecast, the above equation is reordered such
|
||||||
|
that $t$ is substituted with $T+1$.
|
||||||
|
For forecasts further into the future, the actual observations are
|
||||||
|
subsequently replaced by their forecasts.
|
||||||
|
Seasonal ARIMA variants exist; however, the high frequency $k$ in the kind of
|
||||||
|
demand a UDP faces typically renders them impractical as too many
|
||||||
|
coefficients must be estimated.
|
||||||
62
tex/2_lit/2_class/4_stl.tex
Normal file
62
tex/2_lit/2_class/4_stl.tex
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
\subsubsection{Seasonal and Trend Decomposition using Loess}
|
||||||
|
\label{stl}
|
||||||
|
|
||||||
|
A time series $y_t$ may exhibit different types of patterns; to fully capture
|
||||||
|
each of them, the series must be decomposed.
|
||||||
|
Then, each component is forecast with a distinct model.
|
||||||
|
Most commonly, the components are the trend $t_t$, seasonality $s_t$, and
|
||||||
|
remainder $r_t$.
|
||||||
|
They are themselves time series, where only $s_t$ exhibits a periodicity $k$.
|
||||||
|
A decomposition may be additive (i.e., $y_t = s_t + t_t + r_t$) or
|
||||||
|
multiplicative (i.e., $y_t = s_t * t_t * r_t$); the former assumes that
|
||||||
|
the effect of the seasonal component is independent of the overall level
|
||||||
|
of $y_t$ and vice versa.
|
||||||
|
The seasonal component is centered around $0$ in both cases such that its
|
||||||
|
removal does not affect the level of $y_t$.
|
||||||
|
Often, it is sufficient to only seasonally adjust the time series, and model
|
||||||
|
the trend and remainder together, for example, as $a_t = y_t - s_t$ in the
|
||||||
|
additive case.
|
||||||
|
|
||||||
|
Early approaches employed moving averages (cf., Sub-section \ref{ets}) to
|
||||||
|
calculate a trend component, and, after removing that from $y_t$, averaged
|
||||||
|
all observations of the same seasonal lag to obtain the seasonal
|
||||||
|
component.
|
||||||
|
The downsides of this are the subjectivity in choosing the window lengths for
|
||||||
|
the moving average and the seasonal averaging, the incapability of the
|
||||||
|
seasonal component to vary its amplitude over time, and the missing
|
||||||
|
handling of outliers.
|
||||||
|
|
||||||
|
The X11 method developed at the U.S. Census Bureau and described in detail by
|
||||||
|
\cite{dagum2016} overcomes these disadvantages.
|
||||||
|
However, due to its background in economics, it is designed primarily for
|
||||||
|
quarterly or monthly data, and the change in amplitude over time cannot be
|
||||||
|
controlled.
|
||||||
|
Variants of this method are the SEATS decomposition by the Bank of Spain and
|
||||||
|
the newer X13-SEATS-ARIMA method by the U.S. Census Bureau.
|
||||||
|
Their main advantages stem from the fact that the models calibrate themselves
|
||||||
|
according to statistical criteria without manual work for a statistician
|
||||||
|
and that the fitting process is robust to outliers.
|
||||||
|
|
||||||
|
\cite{cleveland1990} introduce a seasonal and trend decomposition using a
|
||||||
|
repeated locally weighted regression - the so-called Loess procedure - to
|
||||||
|
smoothen the trend and seasonal components, which can be viewed as a
|
||||||
|
generalization of the methods above and is denoted by the acronym
|
||||||
|
\gls{stl}.
|
||||||
|
In contrast to the X11, X13, and SEATS methods, the STL supports seasonalities
|
||||||
|
of any lag $k$ that must, however, be determined with additional
|
||||||
|
statistical tests or set with out-of-band knowledge by the forecaster
|
||||||
|
(e.g., hourly demand data implies $k = 24 * 7 = 168$ assuming customer
|
||||||
|
behavior differs on each day of the week).
|
||||||
|
Moreover, the seasonal component's rate of change, represented by the $ns$
|
||||||
|
parameter and explained in detail with Figure \ref{f:stl} in Section
|
||||||
|
\ref{decomp}, must be set by the forecaster as well, while the trend's
|
||||||
|
smoothness may be controlled via setting a non-default window size.
|
||||||
|
Outliers are handled by assignment to the remainder such that they do not
|
||||||
|
affect the trend and seasonal components.
|
||||||
|
In particular, the manual input needed to calibrate the STL explains why only
|
||||||
|
the X11, X13, and SEATS methods are widely used by practitioners.
|
||||||
|
However, the widespread adoption of concepts like cross-validation (cf.,
|
||||||
|
Sub-section \ref{cv}) in recent years enables the usage of an automated
|
||||||
|
grid search to optimize the parameters.
|
||||||
|
The STL's usage within a grid search is facilitated even further by its being
|
||||||
|
computationally cheaper than the other methods discussed.
|
||||||
15
tex/2_lit/3_ml/1_intro.tex
Normal file
15
tex/2_lit/3_ml/1_intro.tex
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
\subsection{Demand Forecasting with Machine Learning Methods}
|
||||||
|
\label{ml_methods}
|
||||||
|
|
||||||
|
ML methods have been employed in all kinds of prediction tasks in recent
|
||||||
|
years.
|
||||||
|
In this section, we restrict ourselves to the models that performed well in
|
||||||
|
our study: Random Forest (\gls{rf}) and Support Vector Regression
|
||||||
|
(\gls{svr}).
|
||||||
|
RFs are in general well-suited for datasets without a priori knowledge about
|
||||||
|
the patterns, while SVR is known to perform well on time series data, as
|
||||||
|
shown by \cite{hansen2006} in general and \cite{bao2004} specifically for
|
||||||
|
intermittent demand.
|
||||||
|
Gradient Boosting, another popular ML method, was consistently outperformed by
|
||||||
|
RFs, and artificial neural networks require an amount of data
|
||||||
|
exceeding what our industry partner has by far.
|
||||||
53
tex/2_lit/3_ml/2_learning.tex
Normal file
53
tex/2_lit/3_ml/2_learning.tex
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
\subsubsection{Supervised Learning}
|
||||||
|
\label{learning}
|
||||||
|
|
||||||
|
A conceptual difference between classical and ML methods is the format
|
||||||
|
for the model inputs.
|
||||||
|
In ML models, a time series $Y$ is interpreted as labeled data.
|
||||||
|
Labels are collected into a vector $\vec{y}$ while the corresponding
|
||||||
|
predictors are aligned in an $(T - n) \times n$ matrix $\mat{X}$:
|
||||||
|
$$
|
||||||
|
\vec{y}
|
||||||
|
=
|
||||||
|
\begin{pmatrix}
|
||||||
|
y_T \\
|
||||||
|
y_{T-1} \\
|
||||||
|
\dots \\
|
||||||
|
y_{n+1}
|
||||||
|
\end{pmatrix}
|
||||||
|
~~~~~~~~~~
|
||||||
|
\mat{X}
|
||||||
|
=
|
||||||
|
\begin{bmatrix}
|
||||||
|
y_{T-1} & y_{T-2} & \dots & y_{T-n} \\
|
||||||
|
y_{T-2} & y_{T-3} & \dots & y_{T-(n+1)} \\
|
||||||
|
\dots & \dots & \dots & \dots \\
|
||||||
|
y_n & y_{n-1} & \dots & y_1
|
||||||
|
\end{bmatrix}
|
||||||
|
$$
|
||||||
|
The $m = T - n$ rows are referred to as samples and the $n$ columns as
|
||||||
|
features.
|
||||||
|
Each row in $\mat{X}$ is "labeled" by the corresponding entry in $\vec{y}$,
|
||||||
|
and ML models are trained to fit the rows to their labels.
|
||||||
|
Conceptually, we model a functional relationship $f$ between $\mat{X}$ and
|
||||||
|
$\vec{y}$ such that the difference between the predicted
|
||||||
|
$\vec{\hat{y}} = f(\mat{X})$ and the true $\vec{y}$ are minimized
|
||||||
|
according to some error measure $L(\vec{\hat{y}}, \vec{y})$, where $L$
|
||||||
|
summarizes the goodness of the fit into a scalar value (e.g., the
|
||||||
|
well-known mean squared error [MSE]; cf., Section \ref{mase}).
|
||||||
|
$\mat{X}$ and $\vec{y}$ show the ordinal character of time series data:
|
||||||
|
Not only overlap the entries of $\mat{X}$ and $\vec{y}$, but the rows of
|
||||||
|
$\mat{X}$ are shifted versions of each other.
|
||||||
|
That does not hold for ML applications in general (e.g., the classical
|
||||||
|
example of predicting spam vs. no spam emails, where the features model
|
||||||
|
properties of individual emails), and most of the common error measures
|
||||||
|
presented in introductory texts on ML, are only applicable in cases
|
||||||
|
without such a structure in $\mat{X}$ and $\vec{y}$.
|
||||||
|
$n$, the number of past time steps required to predict a $y_t$, is an
|
||||||
|
exogenous model parameter.
|
||||||
|
For prediction, the forecaster supplies the trained ML model an input
|
||||||
|
vector in the same format as a row $\vec{x}_i$ in $\mat{X}$.
|
||||||
|
For example, to predict $y_{T+1}$, the model takes the vector
|
||||||
|
$(y_T, y_{T-1}, ..., y_{T-n+1})$ as input.
|
||||||
|
That is in contrast to the classical methods, where we only supply the number
|
||||||
|
of time steps to be predicted as a scalar integer.
|
||||||
38
tex/2_lit/3_ml/3_cv.tex
Normal file
38
tex/2_lit/3_ml/3_cv.tex
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
\subsubsection{Cross-Validation}
|
||||||
|
\label{cv}
|
||||||
|
|
||||||
|
Because ML models are trained by minimizing a loss function $L$, the
|
||||||
|
resulting value of $L$ underestimates the true error we see when
|
||||||
|
predicting into the actual future by design.
|
||||||
|
To counter that, one popular and model-agnostic approach is cross-validation
|
||||||
|
(\gls{cv}), as summarized, for example, by \cite{hastie2013}.
|
||||||
|
CV is a resampling technique, which ranomdly splits the samples into a
|
||||||
|
training and a test set.
|
||||||
|
Trained on the former, an ML model makes forecasts on the latter.
|
||||||
|
Then, the value of $L$ calculated only on the test set gives a realistic and
|
||||||
|
unbiased estimate of the true forecasting error, and may be used for one
|
||||||
|
of two distinct aspects:
|
||||||
|
First, it assesses the quality of a fit and provides an idea as to how the
|
||||||
|
model would perform in production when predicting into the actual future.
|
||||||
|
Second, the errors of models of either different methods or the same method
|
||||||
|
with different parameters may be compared with each other to select the
|
||||||
|
best model.
|
||||||
|
In order to first select the best model and then assess its quality, one must
|
||||||
|
apply two chained CVs:
|
||||||
|
The samples are divided into training, validation, and test sets, and all
|
||||||
|
models are trained on the training set and compared on the validation set.
|
||||||
|
Then, the winner is retrained on the union of the training and validation
|
||||||
|
sets and assessed on the test set.
|
||||||
|
|
||||||
|
Regarding the splitting, there are various approaches, and we choose the
|
||||||
|
so-called $k$-fold CV, where the samples are randomly divided into $k$
|
||||||
|
folds of the same size.
|
||||||
|
Each fold is used as a test set once and the remaining $k-1$ folds become
|
||||||
|
the corresponding training set.
|
||||||
|
The resulting $k$ error measures are averaged.
|
||||||
|
A $k$-fold CV with $k=5$ or $k=10$ is a compromise between the two extreme
|
||||||
|
cases of having only one split and the so-called leave-one-out CV
|
||||||
|
where $k = m$: Computation is still relatively fast and each sample is
|
||||||
|
part of several training sets maximizing the learning from the data.
|
||||||
|
We adapt the $k$-fold CV to the ordinal stucture in $\mat{X}$ and $\vec{y}$ in
|
||||||
|
Sub-section \ref{unified_cv}.
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue