Back to Blog Späť na blog

MSTL Decomposition: Separating Real Growth from Seasonal Noise

MSTL Decomposition: Separating Real Growth from Seasonal Noise
Key Takeaway: When your Q4 sales spike 29% above your annual average, the critical question isn’t whether sales increased-it’s whether your business actually grew. MSTL decomposition answers this question by mathematically separating genuine trend movements from the predictable rhythms of weekly, monthly, and yearly seasonality. For e-commerce and retail executives, this distinction determines whether you’re building lasting value or merely riding seasonal waves.

Time series decomposition has evolved dramatically since its origins in the 1920s. Classical methods assumed rigid, unchanging seasonal patterns-a limitation that fails modern e-commerce data with its overlapping daily, weekly, and yearly cycles. MSTL (Multiple Seasonal-Trend decomposition using Loess), developed by Bandara, Hyndman, and Bergmeir in 2021[2], solves this multi-seasonality problem efficiently, enabling businesses to extract clean trend signals from complex, high-frequency data.

MSTL separates your data into interpretable components: the underlying trend (your true business trajectory), multiple seasonal patterns (predictable cycles), and the remainder (anomalies, campaign effects, and noise). This separation transforms “sales went up” into actionable intelligence about why sales moved.

The Multi-Seasonality Challenge in Retail Data

E-commerce data exhibits multiple overlapping seasonal patterns that confound simple analysis. Your daily sales fluctuate with weekly patterns-weekday versus weekend shopping behavior typically shows consistent differences. Simultaneously, yearly patterns drive massive swings: analysis of over €21 billion in real merchant sales data reveals November averages 29% more orders than the annual mean, while summer months run 30% below peak levels[6]. Layer in monthly payday effects and promotional calendars, and the signal becomes extraordinarily noisy.

Simple moving averages fail this complexity. A 7-day moving average removes weekly patterns but smears yearly seasonality across months. A 365-day average eliminates annual cycles but requires a full year of data before producing any output-and completely misses weekly patterns. Businesses using these crude approaches consistently misdiagnose performance, confusing seasonal effects with actual growth or decline.

Figure 1: E-commerce daily revenue showing overlapping weekly and yearly seasonal patterns

The chart above illustrates a typical e-commerce pattern: strong weekly oscillations (weekend dips) combined with a yearly cycle (holiday peak in December). Notice how difficult it becomes to judge whether the business is actually growing when these patterns overlap. Is the upward movement in November genuine growth or just predictable holiday shopping?

Understanding What Decomposition Reveals

MSTL decomposition breaks your time series into distinct, interpretable components. Each serves a specific analytical purpose for business decision-making.

The trend component represents your business’s long-term direction after removing all seasonal effects. This is the signal executives and investors actually need: is the underlying business expanding, contracting, or holding steady? A rising trend with flat raw sales indicates genuine growth masked by off-peak timing. A flat trend during a sales spike reveals you’re merely riding seasonal tailwinds.

Seasonal components capture the predictable, repeating patterns in your data. MSTL extracts multiple seasonal cycles simultaneously-daily patterns for hourly data, weekly patterns for daily data, yearly patterns for both. These components quantify exactly how much of your variation is explained by predictable cycles rather than business performance. For daily e-commerce data, typical configurations extract both weekly (period = 7) and yearly (period = 365.25) seasonality[2][4].

The remainder component contains everything unexplained by trend and seasonality: random noise, data quality issues, and-crucially-the effects of interventions like marketing campaigns, price changes, or operational disruptions. Anomalies in the remainder signal events worth investigating, while consistent patterns suggest you’ve missed a seasonal cycle.

Additive versus Multiplicative Decomposition

When your December sales spike by €100,000 regardless of whether you’re a €1M or €10M business, that’s additive seasonality-fixed dollar swings. When December consistently runs 20% above average regardless of your baseline, that’s multiplicative seasonality-percentage-based swings.

Most retail businesses exhibit multiplicative patterns: seasonal variation scales with business size. MSTL handles this by first applying a logarithmic transformation, decomposing the transformed data additively, then reversing the transformation[3].

How MSTL Actually Works (Without the Equations)

MSTL builds on a technique called Loess smoothing-locally estimated scatterplot smoothing[1]. Rather than fitting one formula to your entire dataset, Loess fits many small, localized models. Imagine drawing a smooth curve through your data where each point’s value is influenced primarily by nearby observations. This approach adapts naturally to changing patterns without requiring you to specify the exact mathematical form in advance.

The original STL algorithm, developed by Cleveland and colleagues in 1990[1], applied Loess iteratively to separate a single seasonal pattern from trend. It works by repeatedly estimating the seasonal component, removing it to reveal the trend, refining the trend estimate, then updating the seasonal estimate. This iteration continues until the components stabilize. STL’s key advantage over classical decomposition: it allows seasonal patterns to evolve gradually over time rather than assuming they’re fixed forever.

MSTL extends STL to handle multiple seasonal periods by applying the algorithm iteratively[2]. Starting with the shortest seasonal cycle (such as daily patterns in hourly data), it extracts that component and removes it from the series. Then it moves to the next longer cycle (weekly), extracts that pattern, and continues until all specified seasonalities are separated. The final trend emerges from what remains after removing all seasonal components.

Figure 2: MSTL decomposition separates the raw data from Figure 1 into interpretable components. Hover over any point to see how trend + seasonal + remainder equals the original value.

The decomposition above shows how MSTL separates the raw signal into its constituent parts. The trend line (yellow) reveals steady underlying growth that was obscured in the raw data. The yearly seasonal component (blue) shows the predictable holiday surge. The remainder (gray) contains the unexplained variation-including the weekly seasonal pattern and random noise-representing potential anomalies worth investigating. Notice how these three components mathematically add up to reconstruct the original revenue data from Figure 1.

Practical Parameter Choices for Business Data

MSTL requires you to specify which seasonal periods to extract. For most e-commerce businesses with daily data, weekly (7) and yearly (365.25) seasonality captures the dominant patterns[4]. Hourly data typically requires daily (24) and weekly (168) periods. The algorithm’s default window sizes work well for most applications, though businesses with rapidly changing seasonal patterns may benefit from smaller windows that allow faster adaptation.

Data Frequency Common Seasonal Periods Typical Use Case
Daily 7 (weekly), 365.25 (yearly) E-commerce sales, retail transactions
Hourly 24 (daily), 168 (weekly) Website traffic, energy demand
Monthly 12 (yearly) Financial reporting, inventory planning
Weekly 52 (yearly) Wholesale orders, B2B sales

The robust option deserves attention for any business data that may contain outliers. When enabled, MSTL down-weights observations with unusually large residuals, preventing single extreme days (flash sales, system outages, or data errors) from distorting your trend and seasonal estimates[4]. This proves essential for data spanning disruptions like COVID-19 or major promotional events.

Implementation in QuantixAI

QuantixAI’s time series analysis automatically handles parameter selection for MSTL decomposition. The platform detects your data frequency (hourly, daily, weekly, monthly) and configures appropriate seasonal periods without requiring manual specification.

For businesses that need finer control, you can customize the trend window length-the period over which the algorithm calculates the underlying trend. For example, with daily e-commerce data, you might use a 90-day window to identify quarterly business trends while filtering out shorter-term fluctuations. Longer windows (180-365 days) smooth more aggressively, revealing only major directional shifts; shorter windows (30-60 days) adapt faster to changing business conditions.

This flexibility lets you match the analysis to your decision timeline: use longer windows for strategic planning discussions, shorter windows for operational adjustments.

Seasonally Adjusted Data: Your Apples-to-Apples Comparison

One of the most practical outputs from MSTL decomposition is seasonally adjusted data-your observed values with the seasonal component mathematically removed. This simple transformation answers one of the most frustrating questions in business reporting: “How do we fairly compare July performance to December when December always runs 30% higher?”

Seasonally adjusted data equals your observed values minus the seasonal components. What remains is the combination of your trend and remainder (Trend + Remainder = Observed – Seasonal). This creates a level playing field for period-to-period comparisons because you’ve removed the predictable calendar effects that distort raw numbers.

Figure 2b: Seasonally adjusted data (yellow) removes seasonal patterns, revealing the true business trajectory compared to raw data (dark blue)

Why Businesses Need Seasonally Adjusted Comparisons

Raw data comparisons mislead decision-makers constantly. When your CFO asks “Did we improve this quarter?”, comparing Q4 raw sales to Q3 raw sales is meaningless-Q4 includes holiday shopping while Q3 includes summer doldrums. The 25% revenue increase might represent zero actual improvement in your business fundamentals once you account for normal seasonal patterns.

Seasonally adjusted data enables three critical business functions:

1. Accurate month-over-month performance tracking. Marketing directors need to know whether September’s sales dip represents a real problem or just back-to-school season ending. Seasonally adjusted figures immediately reveal whether you’re below, at, or above your expected trajectory after accounting for normal September patterns. This prevents panic over predictable fluctuations while highlighting genuine performance issues.

2. Fair year-over-year growth measurement. Comparing this December to last December controls for one seasonal cycle but misses trend changes that occurred throughout the year. Seasonally adjusted figures let you track momentum on a continuous basis: “Are we growing faster this quarter than last quarter?” becomes answerable with statistical rigor rather than gut feel.

3. Credible board and investor reporting. Sophisticated stakeholders expect seasonally adjusted figures because raw numbers obscure business reality. When presenting quarterly results, showing both raw revenue and seasonally adjusted revenue demonstrates analytical maturity. A board sees immediately whether your Q4 success represents genuine growth or merely capturing your normal seasonal share.

Real-World Scenario: E-Commerce Executive Dashboard

Your executive dashboard tracks monthly revenue, and December just closed at €750k versus November’s €680k-a 10% increase. Your CEO celebrates the “substantial growth.” But your seasonally adjusted view tells a different story:

  • November seasonally adjusted: €692k (slightly above the seasonal baseline)
  • December seasonally adjusted: €725k (slightly below the seasonal baseline)

The seasonally adjusted figures reveal that half of the December’s raw growth was explained by normal seasonal patterns. This insight completely changes the strategic discussion from “what’s working?” to “why did momentum slow during peak season?”

Many national statistical agencies publish only seasonally adjusted economic indicators-GDP growth, employment figures, retail sales-precisely because raw comparisons mislead policymakers. The same logic applies to business metrics. When your competitors report growth, they’re often citing seasonally adjusted figures. Comparing your raw numbers to their adjusted figures systematically understates your performance during off-peak periods and overstates it during peaks.

Implementation in Reporting and KPIs

Practical implementation means maintaining dual reporting: raw numbers for absolute context (actual dollars in the bank) and seasonally adjusted figures for performance evaluation (did we beat our expected trajectory). Your monthly business review should show both:

  • Raw revenue: €680k (actual cash received)
  • Seasonally adjusted revenue: €692k (performance relative to seasonal expectations)
  • Year-over-year growth (raw): +15% (comparing to last November’s raw figure)
  • Year-over-year growth (SA): +8% (true underlying business growth)

The difference between these figures -€12k in the example above-represents the seasonal effect. November ran slightly above its typical seasonal pattern, which is why the seasonally adjusted figure exceeds the raw figure. In December, this relationship typically reverses as raw figures surge above seasonally adjusted ones.

Three Applications That Drive Business Decisions

1. Distinguishing Real Growth from Seasonal Illusions

The most common misinterpretation in retail analytics: confusing seasonal peaks with business growth. When a board member asks “how did we do in Q4?”, showing raw revenue gains proves nothing – Q4 includes Black Friday, Cyber Monday, and holiday shopping. What matters is whether your deseasonalized trend moved upward.

MSTL enables precise year-over-year trend comparisons that control for seasonal effects. By extracting the trend component, you can compare your trajectory in December to your trajectory in June on equal footing. A rising trend indicates genuine improvement in your business fundamentals. A flat trend during a sales spike means you captured your expected seasonal share but didn’t outperform your baseline trajectory.

2. Measuring Whether Marketing Campaigns Actually Worked

Every marketer faces the attribution challenge: did that expensive Q4 campaign drive incremental sales, or would customers have purchased anyway during the holiday season? Decomposition provides the analytical framework to answer this question rigorously.

The approach establishes a baseline expectation using trend and seasonal components-what sales would have been without the campaign, given normal patterns. The remainder component during the campaign period then reveals the incremental lift attributable to marketing activities. A significantly positive remainder during and immediately after the campaign suggests genuine impact; a remainder near zero indicates the campaign may have captured demand that would have occurred naturally.

Figure 3: Campaign impact analysis comparing actual revenue to seasonal baseline

This visualization shows how deseasonalized analysis clarifies campaign impact. The yellow baseline represents expected performance given trend and seasonal patterns. Actual revenue exceeding this baseline (shown in dark blue) during the campaign period represents incremental lift. Notice how the raw comparison would dramatically overstate campaign effectiveness by including the normal seasonal surge.

3. Detecting Genuine Anomalies Versus Normal Fluctuations

When Monday’s sales drop 15%, should you panic? The answer depends entirely on whether Monday typically runs below average and whether this Monday’s deviation exceeds normal variation. Decomposition provides the framework to distinguish genuine problems from statistical noise.

Anomaly detection in deseasonalized data operates on the remainder component. After removing trend and all seasonal effects, what remains should be random noise centered around zero. Remainders significantly above or below zero signal events worth investigating: supply chain issues, competitor actions, pricing errors, or emerging market shifts. This approach prevents false alarms from predictable seasonal dips while catching genuine deviations.

Common Pitfalls That Undermine Analysis Quality

Specifying wrong seasonal periods produces nonsensical results. If you configure yearly seasonality as period = 52 when your data is daily (should be 365.25), the algorithm will attempt to extract a pattern that doesn’t exist at that frequency. The result: seasonality “leaks” into your trend and remainder components, contaminating all downstream analysis. Always verify your data frequency and match seasonal periods accordingly.

Insufficient historical data prevents reliable decomposition. MSTL requires at least two complete cycles of your longest seasonal period to distinguish genuine patterns from noise[2][3]. For yearly seasonality, this means two or more years of data minimum, with three to four years strongly preferred. Attempting decomposition on shorter series produces unstable estimates that may reverse dramatically as more data arrives.

Ignoring multiplicative patterns distorts seasonal magnitude estimates. When your seasonal swings scale proportionally with your business size-as they do for most retail operations-failing to apply logarithmic transformation before decomposition underestimates seasonality during growth periods and overestimates it during contractions. If your December spike was 20% five years ago and 20% today, but your business tripled, multiplicative decomposition captures this consistency correctly.

Missing data creates alignment problems. Decomposition algorithms assume regular time intervals. Gaps in your data-whether from system outages, weekend closures, or irregular reporting-require explicit handling through interpolation before decomposition[4]. Ignoring this produces misaligned seasonal estimates that corrupt your entire analysis.

Pitfall Symptom Solution
Wrong seasonal periods Seasonal component looks random; trend captures obvious seasonality Verify data frequency; use autocorrelation plots to identify true periods
Insufficient data Error messages; unstable estimates that change dramatically Ensure 2+ complete cycles of longest seasonal period
Ignoring multiplicative patterns Remainder shows systematic patterns correlated with trend level Apply log transformation before decomposition
Missing data Shifted seasonal patterns; unexplained spikes in remainder Interpolate gaps before decomposition

From Analysis to Action

MSTL decomposition transforms the fundamental questions executives ask about their business. “Did sales grow?” becomes “Did the underlying trend improve after controlling for seasonal effects?” The campaign review shifts from “revenue increased” to “did revenue exceed what seasonality alone would explain?” Performance monitoring evolves from reacting to every fluctuation to investigating genuine anomalies in deseasonalized data.

This analytical framework requires neither statistical expertise nor programming skills to apply. Modern platforms handle the computational complexity, delivering trend lines, seasonal patterns, and anomaly flags directly. What matters is understanding what these components mean and how they inform decisions-the interpretive layer that converts decomposition outputs into strategic insights.

The businesses that thrive in competitive retail environments share a common trait: they distinguish signal from noise in their data. When your competitor mistakes a seasonal peak for momentum and overinvests, while you recognize flat underlying trends and optimize accordingly, decomposition delivers concrete competitive advantage. MSTL makes that distinction accessible, reliable, and actionable.

See Your True Growth Trajectory with QuantixAI

Our platform automatically applies MSTL decomposition to your sales data, separating trend from seasonal patterns without requiring configuration. Connect your data and start seeing real performance signals in minutes.

Start Free Trial

References

  1. Cleveland, R. B., Cleveland, W. S., McRae, J. E., & Terpenning, I. J. (1990). STL: A Seasonal-Trend Decomposition Procedure Based on Loess. Journal of Official Statistics, 6(1), 3–73.
  2. Bandara, K., Hyndman, R. J., & Bergmeir, C. (2021). MSTL: A Seasonal-Trend Decomposition Algorithm for Time Series with Multiple Seasonal Patterns. arXiv preprint arXiv:2107.13462. https://arxiv.org/abs/2107.13462
  3. Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts. Chapter 3: Time Series Decomposition. https://otexts.com/fpp3/decomposition.html
  4. Hyndman, R. J. et al. (2023). forecast: Forecasting functions for time series and linear models. R package documentation: mstl function. https://search.r-project.org/CRAN/refmans/forecast/html/mstl.html
  5. Python statsmodels contributors. (2024). MSTL: Multiple Seasonal-Trend Decomposition. statsmodels documentation. https://www.statsmodels.org/stable/generated/statsmodels.tsa.seasonal.MSTL.html
  6. Syncio. (2024). E-commerce Seasonality: Hidden patterns from €21bn in real sales data. https://www.syncio.co/blog/ecommerce-seasonality