Inferensys

Glossary

STL Decomposition

A robust time series filtering procedure that decomposes a signal into seasonal, trend, and residual components using locally weighted regression, commonly applied to isolate diurnal solar patterns from weather-driven noise.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
TIME SERIES SIGNAL PROCESSING

What is STL Decomposition?

A robust, iterative filtering procedure for decomposing a time series into trend, seasonal, and residual components using locally weighted regression (LOESS).

STL Decomposition (Seasonal-Trend decomposition using LOESS) is a versatile and robust filtering algorithm that decomposes a time series signal into three additive components: a low-frequency trend, a repeating seasonal pattern, and a high-frequency residual (remainder) capturing noise and anomalies. Unlike classical decomposition methods, STL handles any type of seasonality, not just monthly or quarterly, and is highly resistant to the distorting effects of transient outliers in the data.

The procedure operates iteratively through an inner loop of LOESS smoothing against cyclic sub-series and an outer loop that computes robustness weights to down-weight extreme residuals. In renewable forecasting, STL is commonly applied to isolate the stable diurnal solar generation pattern from volatile weather-driven noise, allowing grid operators to model the predictable baseline separately from the stochastic cloud-driven irradiance ramp rate.

CORE MECHANISMS

Key Features of STL Decomposition

STL (Seasonal-Trend decomposition using LOESS) is a versatile and robust filtering procedure for decomposing a time series. It isolates the systematic components of a signal, making it indispensable for understanding the underlying drivers of variable renewable generation data.

01

LOESS-Based Robustness

Unlike classical decomposition methods that rely on simple moving averages, STL uses Locally Estimated Scatterplot Smoothing (LOESS). This non-parametric method fits low-degree polynomials to localized subsets of the data. This provides superior handling of non-linear trends and irregular seasonal patterns common in solar irradiance data, and is inherently robust to outliers that would otherwise distort the decomposition.

02

Component Isolation

STL decomposes a time series into three additive components:

  • Trend (T_t): The long-term, low-frequency variation, such as gradual panel degradation.
  • Seasonal (S_t): The repeating, high-frequency pattern, like the diurnal solar cycle.
  • Remainder (R_t): The stochastic, high-frequency noise left after extracting trend and seasonality, representing weather-driven volatility. This clean separation allows forecasters to model each component independently.
03

Handling Complex Seasonality

A defining strength of STL is its ability to handle seasonal components that evolve over time. The seasonal pattern is not assumed to be constant; it can slowly change in amplitude and shape. This is critical for capturing the shifting shape of the daily solar curve across different months or the gradual change in diurnal wind patterns, providing a more accurate baseline than fixed seasonal dummies.

04

Iterative Inner-Outer Loop Design

The algorithm operates through two nested iterative loops:

  • Inner Loop: Alternates between updating the seasonal and trend components using LOESS smoothing and moving averages to converge on a stable decomposition.
  • Outer Loop: Calculates robustness weights based on the magnitude of the remainder component. Data points with large remainders (anomalies) are down-weighted in subsequent inner loop iterations, making the decomposition resilient to cloud-induced irradiance spikes or sensor errors.
05

Configurable Smoothing Parameters

The user controls the decomposition's granularity through key parameters:

  • n_p: The number of observations per seasonal cycle (e.g., 24 for hourly diurnal data).
  • s_window: The span of the LOESS window for seasonal extraction, controlling how rapidly the seasonal pattern can evolve.
  • t_window: The span for trend extraction, defining the smoothness of the long-term component. This configurability allows precise tuning for intraday forecasting versus day-ahead trend analysis.
06

Preprocessing for Forecasting Pipelines

In renewable generation forecasting, STL is rarely the final model but a critical preprocessing step. By removing the deterministic diurnal cycle (seasonal component), the resulting stationary remainder can be fed into machine learning models like Long Short-Term Memory (LSTM) networks or Gradient Boosting Machines. These models then focus solely on learning the complex, weather-driven residual dynamics, significantly improving forecast accuracy.

STL DECOMPOSITION EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about Seasonal-Trend decomposition using LOESS, its application in renewable energy forecasting, and how it isolates meaningful signals from meteorological noise.

STL decomposition is a robust, iterative filtering procedure that decomposes a time series into three additive components: seasonal, trend, and remainder (residual). The algorithm uses Locally Weighted Scatterplot Smoothing (LOESS) in a nested loop structure. The inner loop iteratively updates the seasonal and trend components: it detrends the series, smooths cycle-subseries to extract the seasonal pattern, applies a low-pass filter to the seasonal component to prevent low-frequency leakage, detrends again, and then deseasonalizes to extract the trend via LOESS smoothing. The outer loop computes robustness weights based on the residuals, down-weighting the influence of outliers or anomalous observations in subsequent inner loop iterations. This dual-loop architecture makes STL uniquely resistant to transient anomalies like sensor dropouts or storm-driven irradiance spikes, which would otherwise distort the decomposition in classical methods like X-11 or SEATS.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.