Skip to main content

A collection of scripts and functions used in the course 'Time Series Analysis with Python'

Project description

Time Series Analysis with Python



PyPI Downloads

This is the collection of notebooks for the course Time Series Analysis with Python. You can view and execute the notebooks by clicking on the buttons below.

📑 Content

  1. Introduction to time series analysis

    • Definition of time series data
    • Main applications of time series analysis
    • Statistical vs dynamical models perspective
    • Components of a time series
    • Additive vs multiplicative models
    • Time series decomposition techniques

    nbviewer or Open In Colab


  1. Stationarity in time series

    • Stationarity in time series
    • Weak vs strong stationarity
    • Autocorrelation and autocovariance
    • Common stationary and nonstationary time series
    • How to identify stationarity
    • Transformations to achieve stationarity

    nbviewer or Open In Colab


  1. Smoothing

    • Smoothing in time series data
    • The mean squared error
    • Simple average, moving average, and weighted moving average
    • Single, double, and triple exponential smoothing

    nbviewer or Open In Colab


  1. AR-MA

    • The autocorrelation function
    • The partial autocorrelation function
    • The Auto-Regressive model
    • The Moving-Average model
    • Reverting stationarity transformations in forecasting

    nbviewer or Open In Colab


  1. ARMA, ARIMA, SARIMA

    • Autoregressive Moving Average (ARMA) models
    • Autoregressive Integrated Moving Average (ARIMA) models
    • SARIMA models (ARIMA model for data with seasonality)
    • Automatic model selection with AutoARIMA
    • Model selection with exploratory data analysis

    nbviewer or Open In Colab


  1. Unit root test and Hurst exponent

    • Unit root test
    • Mean Reversion
    • The Hurst exponent
    • Geometric Brownian Motion
    • Applications in quantitative finance

    nbviewer or Open In Colab


  1. Kalman filter

    • Introduction to Kalman Filter
    • Model components and assumptions
    • The Kalman Filter algorithm
    • Application to static and dynamic one-dimensional data
    • Application to higher-dimensional data

    nbviewer or Open In Colab


  1. Signal transforms and filters

    • Introduction to Fourier Transform, Discrete Fourier Transform, and FFT
    • Fourier Transform of common signals
    • Properties of the Fourier Transform
    • Signal filtering with low-pass, high-pass, band-pass, and bass-stop filters
    • Application of Fourier Transform to time series forecasting

    nbviewer or Open In Colab


  1. Prophet

    • Introduction to Prophet for time series forecasting
    • Advanced modeling of trend, seasonality, and holidays components
    • The Prophet library in Python

    nbviewer or Open In Colab


  1. Neural networks and Reservoir Computing

    • Windowed approaches and Neural Networks for time series forecasting
    • Forecasting with a Multi-Layer Perceptron
    • Recurrent Neural Networks: advantages and challenges
    • Reservoir Computing and the Echo State Network
    • Dimensionality reduction with Principal Component Analysis
    • Forecasting electricity consumption with Multi-Layer Perceptron and Echo State Network

    nbviewer or Open In Colab


  1. Non-linear time series analysis

    • Dynamical systems and nonlinear dynamics
    • Bifurcation diagrams
    • Chaotic systems
    • High-dimensional continuous-time systems
    • Fractal dimensions
    • Phase space reconstruction and Taken's embedding theorem
    • Forecasting time series from nonlinear systems

    nbviewer or Open In Colab


  1. Time series classification and clustering

    • Multivariate time series
    • Time series similarities and dissimilarities
    • Dynamic Time Warping
    • Time series kernels
    • Embedding time series into vectors
    • Classification of time series
    • Clustering of time series
    • Visualize time series with kernel PCA

    nbviewer or Open In Colab


💻 How to code locally

To run the notebooks locally the recommended steps are the following:

  1. Download and install Miniconda.

  2. Download the env.yml file.

  3. Open the shell and navigate to the location with the yml file you just downloaded.

    • If you are on Windows, open the Miniconda shell.
  4. Install the environment with

    > conda env create -f env.yml
    
  5. Activate your environment:

    > conda activate pytsa
    
  6. Go to the folder with the notebooks

  7. Launch Jupyter Lab with the command

    > jupyter lab
    

🎥 Notebook format and slides

The notebooks are structured as a sequence of slides to be presented using RISE. If you open a notebook you will see the following structure:

The top-right button indicates the type of slide, which is stored in the metadata of the cell. To enable the visualization of the slide type you must first install RISE and then on the top menu select View -> Cell Toolbar -> Slieshow. Also, to split the cells like in the example, you must enable Split Cells Notebook from the nbextensions.

By pressing the Enter\Exit RISE Slideshow button at the top you can enter the slideshow presentation.

See the RISE documentation for more info.

📝 Citation

If you are using this material in your courses or in your research, please consider citing it as follows:

@misc{bianchi2024tsbook,
  author       = {Filippo Maria Bianchi},
  title        = {Time Series Analysis with Python},
  year         = {2024},
  howpublished = {Online},
  url          = {https://github.com/FilippoMB/python-time-series-handbook}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsa_course-0.3.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsa_course-0.3.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file tsa_course-0.3.1.tar.gz.

File metadata

  • Download URL: tsa_course-0.3.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for tsa_course-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b1496e29b8b5679ea77cc10759b139012102d159d1684ebd4a162386adda1782
MD5 317e1d24a1e3f146057b17a0a8cbbf17
BLAKE2b-256 bfebb87872d03724793a245b75c7e886674106850d40d8f1987fc8acd5492e4f

See more details on using hashes here.

File details

Details for the file tsa_course-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: tsa_course-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for tsa_course-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5c99bd4c37a13623a4a4939a6dec6b43e7fb96c6103b74fbcee995a50b4e9ab
MD5 14b70605361eba513b34731d0a9169b1
BLAKE2b-256 060d079bc97b5bd5569ae9d3f511baef91209542a4a4afc94ff6eac5d9e2bde1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page