Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Visualizing Time Series Components | Foundations of Time Series Analysis
Time Series Forecasting with ARIMA

bookChallenge: Visualizing Time Series Components

Taak

Swipe to start coding

Your goal is to decompose a time series into its componentstrend, seasonality, and residuals — using the seasonal_decompose() function from statsmodels.

  1. Load the built-in "flights" dataset from seaborn.
  2. Extract the "passengers" column as your target time series.
  3. Apply seasonal_decompose() with an additive model and a period of 12 (months).
  4. Store the result in a variable called decomposition.
  5. Plot the original series, trend, seasonal, and residual components.

seasonal_decompose(series, model="additive", period=12) automatically splits the time series into four parts:

  • trend → long-term movement;
  • seasonal → repeating patterns;
  • resid → random noise;
  • observed → original data.

Each component can be accessed with attributes like .trend, .seasonal, .resid.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

Where can I learn more about this?

close

Awesome!

Completion rate improved to 6.67

bookChallenge: Visualizing Time Series Components

Veeg om het menu te tonen

Taak

Swipe to start coding

Your goal is to decompose a time series into its componentstrend, seasonality, and residuals — using the seasonal_decompose() function from statsmodels.

  1. Load the built-in "flights" dataset from seaborn.
  2. Extract the "passengers" column as your target time series.
  3. Apply seasonal_decompose() with an additive model and a period of 12 (months).
  4. Store the result in a variable called decomposition.
  5. Plot the original series, trend, seasonal, and residual components.

seasonal_decompose(series, model="additive", period=12) automatically splits the time series into four parts:

  • trend → long-term movement;
  • seasonal → repeating patterns;
  • resid → random noise;
  • observed → original data.

Each component can be accessed with attributes like .trend, .seasonal, .resid.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

some-alt