Abstract
An exponentially weighted moving model (EWMM) for a vector time series fits a new data model each time period, based on an exponentially fading loss function on past observed data. The well known and widely used exponentially weighted moving average (EWMA) is a special case that estimates the mean using a square loss function. For quadratic loss functions EWMMs can be fit using a simple recursion that updates the parameters of a quadratic function. For other loss functions, the entire past history must be stored, and the fitting problem grows in size as time increases. We propose a general method for computing an approximation of EWMM, which requires storing only a window of a fixed number of past samples, and uses an additional quadratic term to approximate the loss associated with the data before the window. This approximate EWMM relies on convex optimization, and solves problems that do not grow with time. We compare the estimates produced by our approximation with the estimates from the exact EWMM method.
Introduction
In time-series analysis, the ability to adapt to changing data distributions is critical. The Exponentially Weighted Moving Average (EWMA) has long been the industry standard for this task due to its simplicity and recursive nature. By applying an exponential decay to past observations, EWMA provides a "running" estimate of the mean that prioritizes recent information. However, modern data science often requires more than just a moving average; we frequently need to track moving logistic regressions, quantile estimates, or sparse covariance matrices.
The Exponentially Weighted Moving Model (EWMM) framework generalizes the concept of moving averages to any model that can be expressed as the minimizer of a convex loss function. While theoretically powerful, EWMMs face a significant practical hurdle: for non-quadratic loss functions, the computational cost of an exact solution grows over time, eventually becoming intractable.
The Computational Bottleneck
The primary advantage of the standard EWMA is its recursive update rule: the new average is simply a weighted combination of the previous average and the latest data point. This is possible because the square loss function used in EWMA is quadratic.
When we move to non-quadratic loss functions—such as the cross-entropy loss in logistic regression or the pinball loss in quantile estimation—this recursive property vanishes. To find the exact EWMM estimate at time $t$, one must solve an optimization problem involving all $t$ previous data points. As $t$ increases, the memory required to store the history grows linearly, and the time required to re-solve the optimization problem at each step grows quadratically ($O(t^2)$). For long-running systems, such as financial trading platforms or real-time sensors, this growth eventually makes the system crawl to a halt.
Approximate Finite Memory EWMM
To address this, we propose the Approximate Finite Memory EWMM. The core idea is to maintain a fixed computational footprint by approximating the influence of the distant past. The total loss function at any time $t$ is split into two components:
- The Window: A fixed number ($M$) of the most recent data samples, which are treated exactly.
- The Tail: A summary of all data older than the window ($t - M$).
Because the sum of many convex functions often looks roughly quadratic near its minimum, the "Tail" can be represented by a single quadratic function. This quadratic surrogate serves as a highly efficient "compressed memory" of the historical data.
Approximation Strategies
The paper introduces two primary methods for constructing this quadratic tail:
- Recursive Taylor Approximation: For smooth, differentiable loss functions (e.g., logistic regression), the tail is updated using a second-order Taylor expansion around the previous model estimate.
- Tail Fitting: For non-smooth loss functions (e.g., quantile estimation), where derivatives may not exist, the method samples the true loss function from the past data around the current estimate and fits a quadratic surrogate using least squares.
Experimental Evaluation
The proposed approximation was tested against exact EWMM methods across several domains using both real-world and synthetic data.
Sparse Inverse Covariance Estimation
Using the 10 Industry Portfolio Dataset (daily financial returns from 2020–2024), the researchers demonstrated that the approximate EWMM maintains a constant computation time per update. In contrast, the "naive" exact method showed the expected quadratic growth in processing time, demonstrating that the approximation prevents the computational slowdown inherent in the exact method.
Quantile and Logistic Regression
Using synthetic datasets with smoothly varying underlying parameters, the study compared the accuracy of the approximation. The results showed that the approximate EWMM tracks the "ground truth" parameters and the exact EWMM estimates with negligible error. Crucially, the researchers found that a relatively small window size ($M$)—often roughly equal to the half-life of the exponential decay—is sufficient to achieve high fidelity.
Conclusion and Limitations
The Approximate EWMM framework provides a scalable path for deploying sophisticated time-series models in real-time environments. By replacing an ever-growing history with a fixed-size quadratic approximation, it enables "infinite" operation with constant memory and time requirements.
However, the framework currently relies on convex optimization and cannot be directly applied to non-convex models like deep neural networks. Additionally, storing a quadratic approximation requires $O(m^2)$ space (where $m$ is the number of parameters), which may become a bottleneck for extremely high-dimensional models. Future work may explore methods to further compress the quadratic tail for these larger parameter spaces.
Summary updated