contents

  

Front matter

preface

acknowledgments

about this book

about the author

about the cover illustration

  

Part 1. Time waits for no one

  1 Understanding time series forecasting

  1.1  Introducing time series

Components of a time series

  1.2  Bird’s-eye view of time series forecasting

Setting a goal

Determining what must be forecast to achieve your goal

Setting the horizon of the forecast

Gathering the data

Developing a forecasting model

Deploying to production

Monitoring

Collecting new data

  1.3  How time series forecasting is different from other regression tasks

Time series have an order

Time series sometimes do not have features

  1.4  Next steps

  2 A naive prediction of the future

  2.1  Defining a baseline model

  2.2  Forecasting the historical mean

Setup for baseline implementations

Implementing the historical mean baseline

  2.3  Forecasting last year’s mean

  2.4  Predicting using the last known value

  2.5  Implementing the naive seasonal forecast

  2.6  Next steps

  3 Going on a random walk

  3.1  The random walk process

Simulating a random walk process

  3.2  Identifying a random walk

Stationarity

Testing for stationarity

The autocorrelation function

Putting it all together

Is GOOGL a random walk?

  3.3  Forecasting a random walk

Forecasting on a long horizon

Forecasting the next timestep

  3.4  Next steps

  3.5  Exercises

Simulate and forecast a random walk

Forecast the daily closing price of GOOGL

Forecast the daily closing price of a stock of your choice

Part 2. Forecasting with statistical models

  4 Modeling a moving average process

  4.1  Defining a moving average process

Identifying the order of a moving average process

  4.2  Forecasting a moving average process

  4.3  Next steps

  4.4  Exercises

Simulate an MA(2) process and make forecasts

Simulate an MA(q) process and make forecasts

  5 Modeling an autoregressive process

  5.1  Predicting the average weekly foot traffic in a retail store

  5.2  Defining the autoregressive process

  5.3  Finding the order of a stationary autoregressive process

The partial autocorrelation function (PACF)

  5.4  Forecasting an autoregressive process

  5.5  Next steps

  5.6  Exercises

Simulate an AR(2) process and make forecasts

Simulate an AR(p) process and make forecasts

  6 Modeling complex time series

  6.1  Forecasting bandwidth usage for data centers

  6.2  Examining the autoregressive moving average process

  6.3  Identifying a stationary ARMA process

  6.4  Devising a general modeling procedure

Understanding the Akaike information criterion (AIC)

Selecting a model using the AIC

Understanding residual analysis

Performing residual analysis

  6.5  Applying the general modeling procedure

  6.6  Forecasting bandwidth usage

  6.7  Next steps

  6.8  Exercises

Make predictions on the simulated ARMA(1,1) process

Simulate an ARMA(2,2) process and make forecasts

  7 Forecasting non-stationary time series

  7.1  Defining the autoregressive integrated moving average model

  7.2  Modifying the general modeling procedure to account for non-stationary series

  7.3  Forecasting a non-stationary times series

  7.4  Next steps

  7.5  Exercises

Apply the ARIMA(p,d,q) model on the datasets from chapters 4, 5, and 6

  8 Accounting for seasonality

  8.1  Examining the SARIMA(p,d,q)(P,D,Q)m model

  8.2  Identifying seasonal patterns in a time series

  8.3  Forecasting the number of monthly air passengers

Forecasting with an ARIMA(p,d,q) model

Forecasting with a SARIMA(p,d,q)(P,D,Q)m model

Comparing the performance of each forecasting method

  8.4  Next steps

  8.5  Exercises

Apply the SARIMA(p,d,q)(P,D,Q)m model on the Johnson & Johnson dataset

  9 Adding external variables to our model

  9.1  Examining the SARIMAX model

Exploring the exogenous variables of the US macroeconomics dataset

Caveat for using SARIMAX

  9.2  Forecasting the real GDP using the SARIMAX model

  9.3  Next steps

  9.4  Exercises

Use all exogenous variables in a SARIMAX model to predict the real GDP

10 Forecasting multiple time series

10.1  Examining the VAR model

10.2  Designing a modeling procedure for the VAR(p) model

Exploring the Granger causality test

10.3  Forecasting real disposable income and real consumption

10.4  Next steps

10.5  Exercises

Use a VARMA model to predict realdpi and realcons

Use a VARMAX model to predict realdpi and realcons

11 Capstone: Forecasting the number of antidiabetic drug prescriptions in Australia

11.1  Importing the required libraries and loading the data

11.2  Visualizing the series and its components

11.3  Modeling the data

Performing model selection

Conducting residual analysis

11.4  Forecasting and evaluating the model’s performance

11.5  Next steps

Part 3. Large-scale forecasting with deep learning

12 Introducing deep learning for time series forecasting

12.1  When to use deep learning for time series forecasting

12.2  Exploring the different types of deep learning models

12.3  Getting ready to apply deep learning for forecasting

Performing data exploration

Feature engineering and data splitting

12.4  Next steps

12.5  Exercise

13 Data windowing and creating baselines for deep learning

13.1  Creating windows of data

Exploring how deep learning models are trained for time series forecasting

Implementing the DataWindow class

13.2  Applying baseline models

Single-step baseline model

Multi-step baseline models

Multi-output baseline model

13.3  Next steps

13.4  Exercises

14 Baby steps with deep learning

14.1  Implementing a linear model

Implementing a single-step linear model

Implementing a multi-step linear model

Implementing a multi-output linear model

14.2  Implementing a deep neural network

Implementing a deep neural network as a single-step model

Implementing a deep neural network as a multi-step model

Implementing a deep neural network as a multi-output model

14.3  Next steps

14.4  Exercises

15 Remembering the past with LSTM

15.1  Exploring the recurrent neural network (RNN)

15.2  Examining the LSTM architecture

The forget gate

The input gate

The output gate

15.3  Implementing the LSTM architecture

Implementing an LSTM as a single-step model

Implementing an LSTM as a multi-step model

Implementing an LSTM as a multi-output model

15.4  Next steps

15.5  Exercises

16 Filtering a time series with CNN

16.1  Examining the convolutional neural network (CNN)

16.2  Implementing a CNN

Implementing a CNN as a single-step model

Implementing a CNN as a multi-step model

Implementing a CNN as a multi-output model

16.3  Next steps

16.4  Exercises

17 Using predictions to make more predictions

17.1  Examining the ARLSTM architecture

17.2  Building an autoregressive LSTM model

17.3  Next steps

17.4  Exercises

18 Capstone: Forecasting the electric power consumption of a household

18.1  Understanding the capstone project

Objective of this capstone project

18.2  Data wrangling and preprocessing

Dealing with missing data

Data conversion

Data resampling

18.3  Feature engineering

Removing unnecessary columns

Identifying the seasonal period

Splitting and scaling the data

18.4  Preparing for modeling with deep learning

Initial setup

Defining the DataWindow class

Utility function to train our models

18.5  Modeling with deep learning

Baseline models

Linear model

Deep neural network

Long short-term memory (LSTM) model

Convolutional neural network (CNN)

Combining a CNN with an LSTM

The autoregressive LSTM model

Selecting the best model

18.6  Next steps

Part 4. Automating forecasting at scale

19 Automating time series forecasting with Prophet

19.1  Overview of the automated forecasting libraries

19.2  Exploring Prophet

19.3  Basic forecasting with Prophet

19.4  Exploring Prophet’s advanced functionality

Visualization capabilities

Cross-validation and performance metrics

Hyperparameter tuning

19.5  Implementing a robust forecasting process with Prophet

Forecasting project: Predicting the popularity of “chocolate” searches on Google

Experiment: Can SARIMA do better?

19.6  Next steps

19.7  Exercises

Forecast the number of air passengers

Forecast the volume of antidiabetic drug prescriptions

Forecast the popularity of a keyword on Google Trends

20 Capstone: Forecasting the monthly average retail price of steak in Canada

20.1  Understanding the capstone project

Objective of the capstone project

20.2  Data preprocessing and visualization

20.3  Modeling with Prophet

20.4  Optional: Develop a SARIMA model

20.5  Next steps

21 Going above and beyond

21.1  Summarizing what you’ve learned

Statistical methods for forecasting

Deep learning methods for forecasting

Automating the forecasting process

21.2  What if forecasting does not work?

21.3  Other applications of time series data

21.5  Keep practicing

  

Appendix. Installation instructions

  

index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.219.78