-
Book Overview & Buying
-
Table Of Contents
Time Series with PyTorch
By :
The data generating process for time series can be rather complex and highly diverse. Before diving into machine learning models, it is essential to develop intuitions of some fundamental data generating processes that underlie time series data. In this section, we provide an example by generating the number of visitors in a kiosk store, focusing on daily cycles.
Simulating visitor numbers can start simply with a Poisson distribution, which models the occurrence of events—in our case, number of visitors—within a set time frame. There is only one single parameter in a Poisson distribution, i.e., the expected number of visitors within 5 minutes. We use the numpy library to generate random visitor counts. To make the simulation more realistic, we also introduce a daily pattern. In the following discussions, we will assume that the number of visitors follows a sine wave pattern, where the number of expected visitors peaks at noon.
Guided...