Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Additive vs Multiplicative Decomposition | Section
Deconstructing Temporal Patterns

bookAdditive vs Multiplicative Decomposition

Sveip for å vise menyen

Understanding how to break down time series data into its underlying components is crucial for effective analysis. Two primary approaches are additive decomposition and multiplicative decomposition. In an additive model, the components—trend, seasonality, and residual—combine through simple addition. The relationship is described as:

Time series=Trend+Seasonality+Residual\text{Time series} = \text{Trend} + \text{Seasonality} + \text{Residual}

This model is appropriate when the seasonal fluctuations and noise remain roughly constant over time, regardless of the trend. For instance, if monthly sales increase by about 100 units every December, regardless of whether the overall sales trend is rising or falling, the additive approach is suitable.

In contrast, a multiplicative model assumes the components interact through multiplication:

Time series=Trend×Seasonality×Residual\text{Time series} = \text{Trend} × \text{Seasonality} × \text{Residual}

Use the multiplicative model when the magnitude of seasonal variation grows or shrinks in proportion to the trend. For example, if sales double during the holidays only when the overall sales trend is high, and the seasonal effect scales with the level of the series, a multiplicative decomposition better captures this pattern.

12345678910111213141516171819202122232425262728293031323334353637
import numpy as np import pandas as pd import matplotlib.pyplot as plt # Simulate time series data np.random.seed(42) periods = 72 # 6 years of monthly data time = np.arange(periods) trend = 10 + 0.5 * time # Additive seasonal component seasonal_additive = 5 * np.sin(2 * np.pi * time / 12) # Multiplicative seasonal component seasonal_multiplicative = 1 + 0.3 * np.sin(2 * np.pi * time / 12) # Additive model: constant seasonality additive_series = trend + seasonal_additive + np.random.normal(0, 2, periods) # Multiplicative model: seasonality grows with trend multiplicative_series = trend * seasonal_multiplicative * (1 + np.random.normal(0, 0.05, periods)) # Plot both series fig, axs = plt.subplots(2, 1, figsize=(10, 8), sharex=True) axs[0].plot(time, additive_series, label="Additive Series") axs[0].set_title("Additive Seasonal Pattern") axs[0].set_ylabel("Value") axs[0].legend() axs[1].plot(time, multiplicative_series, label="Multiplicative Series", color="orange") axs[1].set_title("Multiplicative Seasonal Pattern") axs[1].set_xlabel("Time (Months)") axs[1].set_ylabel("Value") axs[1].legend() plt.tight_layout() plt.show()
copy

Choosing between additive and multiplicative decomposition depends on the characteristics of your data. If the amplitude of the seasonal pattern remains steady as the trend changes, the additive model is usually best. If the seasonal effect becomes more pronounced as the data grows or shrinks, the multiplicative model captures this scaling behavior more accurately. Always visualize your data and consider the nature of both the trend and seasonality before selecting a decomposition approach.

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 7

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Seksjon 1. Kapittel 7
some-alt