Hostname: page-component-89b8bd64d-shngb Total loading time: 0 Render date: 2026-05-08T10:04:10.245Z Has data issue: false hasContentIssue false

Package AdvEMDpy: Algorithmic variations of empirical mode decomposition in Python

Published online by Cambridge University Press:  05 May 2023

Cole van Jaarsveldt*
Affiliation:
School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh EH14 4AS, UK
Matthew Ames
Affiliation:
ResilientML, Melbourne, Australia
Gareth W. Peters
Affiliation:
Department of Statistics & Applied Probability, University of California, Santa Barbara, CA 93106, USA
Mike Chantler
Affiliation:
School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh EH14 4AS, UK
*
*Corresponding author. E-mail: cv25@hw.ac.uk
Rights & Permissions [Opens in a new window]

Abstract

This work presents a $\textsf{Python}$ EMD package named AdvEMDpy that is both more flexible and generalises existing empirical mode decomposition (EMD) packages in $\textsf{Python}$, $\textsf{R}$, and $\textsf{MATLAB}$. It is aimed specifically for use by the insurance and financial risk communities, for applications such as return modelling, claims modelling, and life insurance applications with a particular focus on mortality modelling. AdvEMDpy both expands upon the EMD options and methods available, and improves their statistical robustness and efficiency, providing a robust, usable, and reliable toolbox. Unlike many EMD packages, AdvEMDpy allows customisation by the user, to ensure that a broader class of linear, non-linear, and non-stationary time series analyses can be performed. The intrinsic mode functions (IMFs) extracted using EMD contain complex multi-frequency structures which warrant maximum algorithmic customisation for effective analysis. A major contribution of this package is the intensive treatment of the EMD edge effect which is the most ubiquitous problem in EMD and time series analysis. Various EMD techniques, of varying intricacy from numerous works, have been developed, refined, and, for the first time, compiled in AdvEMDpy. In addition to the EMD edge effect, numerous pre-processing, post-processing, detrended fluctuation analysis (localised trend estimation) techniques, stopping criteria, spline methods, discrete-time Hilbert transforms (DTHT), knot point optimisations, and other algorithmic variations have been incorporated and presented to the users of AdvEMDpy. This paper and the supplementary materials provide several real-world actuarial applications of this package for the user’s benefit.

Information

Type
Actuarial Software
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2023. Published by Cambridge University Press on behalf of Institute and Faculty of Actuaries
Figure 0

Table 1. Table displaying which features are present in AdvEMDpy package versus other available packages in $\textsf{R}$, $\textsf{MATLAB}$, and $\textsf{Python}$.

Figure 1

Figure 1 Figure demonstrating first iteration of Algorithm 1 where extrema are found, splines are fitted through maxima and minima, respectively, to form an envelope, and the local mean is estimated as the average of the extrema splines.

Figure 2

Figure 2 Figure demonstrating incomplete bases at the boundary of the time series to create non-natural cubic B-splines that can accommodate non-zero edge values, derivatives, and curvatures.

Figure 3

Figure 3 Figure demonstrating predefined uniform knot placement and the resulting IMFs.

Figure 4

Figure 4 Figure demonstrating statically optimised knot placement, which is optimised once at outset and used throughout the sifting, and the resulting IMFs.

Figure 5

Figure 5 Figure demonstrating dynamically optimised knot placement, which is optimised at the beginning of each internal sifting routine, and the resulting IMFs.

Figure 6

Figure 6 Example time series demonstrating four (five if conditional symmetric anchor is included) different symmetric edge effect techniques with axes of symmetry included.

Figure 7

Figure 7 Example time series demonstrating detrended fluctuation analysis of time series with different knot sequences resulting in different trend estimation.

Figure 8

Figure 8 Example time series demonstrating detrended fluctuation analysis of time series with different knot sequences resulting in different trend estimation.

Figure 9

Figure 9 Hilbert spectrum of example time series demonstrating the frequencies of the three IMFs present when sufficient knots are used.

Figure 10

Figure 10 Example time series demonstrating unsmoothed extrema envelopes being fitted when SWC are not satisfied resulting in nonsensical envelopes.

Figure 11

Figure 11 Example time series demonstrating five different local mean estimation techniques through detrended fluctuation analysis.

Figure 12

Figure 12 Monthly births in the United Kingdom from January 1938 until December 2018 inclusive, with some notable features and causality.

Figure 13

Figure 13 IF of first IMF extracted using EMD of monthly births in the United Kingdom from January 1938 until December 2018 inclusive, with some features and limits included.

Figure 14

Figure 14 IF of first IMF extracted using EMD and refined using X11 of monthly births in the United Kingdom from January 1938 until December 2018 inclusive, with some features and limits included.

Figure 15

Figure 15 Annual deaths among females in the United Kingdom from 1922 until 2020 inclusive, in a 5-year stratification.

Figure 16

Figure 16 Annual deaths among males in the United Kingdom from 1922 until 2020 inclusive, in a 5-year stratification.

Figure 17

Figure 17 IMF 1 of deaths among females in the United Kingdom from 1922 until 2020 inclusive, in a 5-year stratification.

Figure 18

Figure 18 IMF 1 of deaths among females in the United Kingdom from 1922 until 2020 inclusive, in a 5-year stratification, sorted by birth year.

Figure 19

Figure 19 IMF 1 of deaths among males in the United Kingdom from 1922 until 2020 inclusive, in a 5-year stratification.

Figure 20

Figure 20 IMF 1 of deaths among males in the United Kingdom from 1922 until 2020 inclusive, in a 5-year stratification, sorted by birth.

Supplementary material: PDF

van Jaarsveldt et al. supplementary material

van Jaarsveldt et al. supplementary material 1

Download van Jaarsveldt et al. supplementary material(PDF)
PDF 2.2 MB
Supplementary material: File

van Jaarsveldt et al. supplementary material

van Jaarsveldt et al. supplementary material 2

Download van Jaarsveldt et al. supplementary material(File)
File 40.3 MB
Supplementary material: File

van Jaarsveldt et al. supplementary material

van Jaarsveldt et al. supplementary material 3

Download van Jaarsveldt et al. supplementary material(File)
File 115.4 KB