liveBook · Manning

Trend

As explained in Statistics Every Programmer Needs

A trend component is the part of a time-series representation that captures systematic directional change over time.

A trend is a long-term movement or systematic directional change in a time series. Trends can make the mean and other statistical properties vary over time, producing nonstationary data that complicates forecasting. section 7.3.6 section 7.3.5

Use trend treatment according to the modeling task:

  • Apply first-order differencing by subtracting each observation from its predecessor; this removes trend-related nonstationarity but reduces the record count by one. section 7.3.6
  • Use double exponential smoothing (DES), or Holt’s linear trend model, when the series has an underlying linear trend. section 7.4.6
  • Use Holt–Winters smoothing when trend occurs with seasonality; choose additive or multiplicative seasonality according to whether seasonal variation is constant or changing. section 7.4.4
  • Treat simple exponential smoothing as inappropriate for clear trends because it models level without an explicit trend component. section 7.4.6

Differencing Apple closing prices

For prices [173.300247, 171.953735, 173.210495, 174.457260, 177.030579], first-order differencing produces [-1.346512, 1.256760, 1.246765, 2.573319]. Each result subtracts the previous price from the current price, so the output contains one fewer observation. section 7.3.6

Figure 7.2 Four illustrative time series charts. Three of the subplots display nonstationary data; in contrast, the plot in the lower-right quadrant displays stationary time series data.
figure

Compare illustrative nonstationary series containing trends or seasonality with a stationary series whose statistical properties remain stable. section 7.3.5

How Statistics Every Programmer Needs covers it

How deep it goes
Explains long-term movement, removes it through differencing, and models linear trend with DES; it stops short of broader trend-estimation methods.
Examples
Uses Apple closing prices, first-order differences, and additive-trend DES code as concrete examples.
What it assumes
Assumes time-ordered observations and develops stationarity, seasonality, and differencing as supporting concepts.
What you can do after
Apply it via statsmodels to select DES for trending series and prepare nonstationary data with differencing.
How it connects
Connects trends with seasonality, stationarity, differencing, ARIMA, and exponential smoothing.

Also explained in

Compare how 4 books explain trend →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.