A monthly unemployment dataset contains 48 observations. The following code is to be run:
from statsmodels.tsa.seasonal import STL
result = STL(
data,
period=12,
seasonal=7,
robust=True
).fit()
print(len(result.seasonal))
Assume the observations are valid and no values are missing.
What is the expected output?
A researcher notices that changing the seasonal parameter from 7 to 21 produces a noticeably smoother seasonal component, while period=12 remains unchanged.
Complete the statement:
The parameter seasonal primarily controls ________, whereas period primarily specifies ________.
A government research team performs STL decomposition on two monthly economic indicators.
Statistic | Indicator A | Indicator B |
|---|---|---|
Var(R) | 25 | 16 |
Var(T+R) | 125 | 40 |
Var(S+R) | 50 | 160 |
The researchers want to identify which indicator has stronger trend structure and which has stronger seasonal structure.
Which conclusion is supported by the calculated strength measures?
Match the four observations from a tourism dataset with their most appropriate interpretations.
Observation | Pattern |
|---|---|
P | The extracted long-term movement increases gradually over several years. |
Q | The seasonal contribution for December rises from +60 to +150 across five years. |
R | One month's observed demand differs sharply from the sum of its estimated trend and seasonality. |
S | The extracted seasonal component repeats approximately every 12 observations. |
Interpretations:
Unusual remainder
Annual seasonal cycle in monthly data
Increasing long-term trend
Changing seasonal amplitude
Choose the correct matching.
You have to calculate the seasonal strength from an STL result.
import numpy as np
R = result.resid
S = result.seasonal
T = result.trend
strength = max(
0,
1 - np.var(R) / np.var(_____)
)
Choose the expression that correctly completes the calculation of seasonal strength.
An analyst experiments with different STL smoothing windows for monthly electricity consumption. Which statement is incorrect?
A researcher obtains the following values from STL:
Component | Value |
|---|---|
Trend | 180 |
Seasonal | −25 |
Remainder | +12 |
The original observed value at this point is ________.
A researcher applies STL decomposition to monthly airline passenger data. Four interpretations are proposed. Identify the incorrect statement.
A city experiences a sudden increase in unemployment after a factory closes. Two analysts apply STL decomposition.
Analyst P argues that robust=True should always be used because it removes all abnormal values.
Analyst Q argues that robust decomposition can reduce the influence of isolated extreme observations, but a sustained economic shift may represent a meaningful change that should not automatically be discarded.
Which evaluation is most appropriate?
A data scientist wants to compare how the seasonal pattern of hotel bookings changes across years using STL.
Arrange the following steps in a logically appropriate order.
P. Extract the seasonal component from the fitted decomposition.
Q. Load the observations and establish a valid monthly time index.
R. Compare seasonal values for corresponding months across years.
S. Fit STL using an appropriate seasonal period.