Book Image

Time Series Analysis with Python Cookbook

By : Tarek A. Atwan
Book Image

Time Series Analysis with Python Cookbook

By: Tarek A. Atwan

Overview of this book

Time series data is everywhere, available at a high frequency and volume. It is complex and can contain noise, irregularities, and multiple patterns, making it crucial to be well-versed with the techniques covered in this book for data preparation, analysis, and forecasting. This book covers practical techniques for working with time series data, starting with ingesting time series data from various sources and formats, whether in private cloud storage, relational databases, non-relational databases, or specialized time series databases such as InfluxDB. Next, you’ll learn strategies for handling missing data, dealing with time zones and custom business days, and detecting anomalies using intuitive statistical methods, followed by more advanced unsupervised ML models. The book will also explore forecasting using classical statistical models such as Holt-Winters, SARIMA, and VAR. The recipes will present practical techniques for handling non-stationary data, using power transforms, ACF and PACF plots, and decomposing time series data with multiple seasonal patterns. Later, you’ll work with ML and DL models using TensorFlow and PyTorch. Finally, you’ll learn how to evaluate, compare, optimize models, and more using the recipes covered in the book.
Table of Contents (18 chapters)

Preface

A familiar association people make is between forecasting and financial data. In reality, forecasting is used in many industries, leveraging historical data to make future predictions. More specifically, this book is about time series analysis, a process to gain better insight from historical data, capture trends and cyclical patterns, and build a suitable forecasting model.

When working with data that contains observations that change over time and is recorded at specific intervals, you are dealing with time series data. You will find time series data in many domains, and the discipline of time series analysis covers various use cases. For example, time series analysis is used in science (forecasting weather, earthquakes, air quality, or species growth), finance (forecasting stock return, budget, sales, or volatility), government (forecasting inflation, unemployment rates, GDP, or population birth rate), medical (tracking infectious disease transmission, monitoring electrocardiogram or blood glucose, or forecasting healthcare costs), engineering (predictive maintenance, production decline analysis, or traffic volume forecasting), business (inventory management, product demand planning, resource planning), and much more. Pretty much, time series data is all around us, and you will most definitely be encountering such data.

By picking this book, you are looking for practical recipes that you can apply and use – less on theory and more on the practical. The book will take you through the complete journey of time series analysis, covering the end-to-end process, including acquiring and ingesting various types of time series data, exploring the data, transforming and manipulating the data, and training models to use in forecasting.

The book covers concepts, techniques, and algorithms commonly used and more advanced and recent approaches with practical use. For example, you will learn to train and validate different models covering statistical methods, machine learning algorithms, and various deep learning architectures for forecasting and outlier (or anomaly) detection. Most importantly, the variety of datasets used in this book will give you a better insight into how these different models work and how you can pick the most appropriate approach to solve your specific problem.