Time-series analysis: read trends and validate forecasts
Learn to distinguish trend, seasonality, and autocorrelation, then validate forecasts in chronological order using a documented monthly passenger series.
Time-series analysis studies values recorded in time order so we can explain change and repetition over time. Preserve the order of observations, distinguish trend from seasonality, and examine how values relate to earlier periods. If the goal is forecasting, validate from past to future without allowing future observations into training.
A monthly sales series, daily service requests, and annual population counts are not just lists of numbers: the order and spacing of their timestamps matter. This guide explains how to read a series and how to evaluate forecasts fairly.
Start with the time index and sampling interval
A time series pairs each value with the time it was observed. Before analysis, decide what each row means (a day, month, quarter, or another interval), which time zone and date convention apply, and whether observations are regularly spaced. A midnight inventory snapshot and a trading-day close do not follow the same calendar. Missing dates may be true gaps, holidays, or days with no measurement.
For regular data, a seasonal period can be expressed as the number of observations in one cycle: 12 for monthly data, 4 for quarterly data. R's ts() uses a start time and frequency to describe this structure; frequency = 12 means 12 monthly observations per cycle. Weekly data, holidays, and calendar effects may not fit a single fixed period, so retain actual timestamps and inspect calendar effects separately.
Check duplicate and missing timestamps, reporting delays, and changes in units or collection methods. Do not replace missing values with zero automatically: zero means a measured value of zero, while a missing value means it was not observed. Check the collection rules first, then document how interpolation, exclusion, or replacement affects the question.
Distinguish trend, seasonality, and cycles
In a time plot, a trend is a long-term movement in level. Seasonality is a pattern that repeats at a known calendar interval, such as month or day of week. A cycle rises and falls but does not have a fixed length. A summer rise in visits may be seasonal; economic expansions and contractions with varying durations are closer to cycles. Mark one-off spikes and level shifts, such as a policy change, separately from repeating patterns.
The plot below uses the 144 monthly observations in R's documented AirPassengers data. It records international airline passengers from 1949 through 1960, in thousands. The overall level rises, similar peaks recur each year, and seasonal swings become wider later in the series. This illustrates historical data; it does not describe today's airline market or guarantee future demand.
Figure 1. Connecting monthly observations in time order reveals the long-term level, recurring timing, and changing range together. The vertical scale is passengers in thousands.
For example, January 1949 has 112 thousand passengers, while January 1960 has 417 thousand. That difference signals a large change in long-term level. In 1960, January's 417 thousand and July's 622 thousand also show a within-year seasonal difference. Since the absolute seasonal swing tends to grow as the level rises, a multiplicative structure—seasonal effects proportional to level—may be more plausible than an additive structure with a fixed seasonal amount. This is a clue for model choice, not proof of cause or forecast accuracy.
Use lags and decomposition to inspect patterns
Autocorrelation describes how a value moves with values from earlier periods. Lag 1 compares an observation with the one immediately before it; lag 12 in monthly data compares it with the same month one year earlier. Seasonality may produce recurring autocorrelation at seasonal lags. But a strong trend can also create high autocorrelation across many lags, so read an autocorrelation function (ACF) alongside the time plot rather than treating it as proof of seasonality.
Decomposition separates a series conceptually into trend-cycle, seasonal, and remainder components. Additive decomposition, yₜ = Tₜ + Sₜ + Rₜ, suits seasonal effects whose size is roughly constant regardless of level. Multiplicative decomposition, yₜ = Tₜ × Sₜ × Rₜ, can suit swings proportional to the level; it often assumes positive values. Decomposition does not make the remainder automatically independent or random, and does not guarantee accurate forecasts. Inspect residual patterns and structural changes.
Stationarity means properties such as mean, variance, and autocorrelation do not change substantially over time. Trend and seasonality can make raw data nonstationary; differencing or transformation may reduce some patterns. These are not compulsory first steps for every analysis. If the goal is to describe change, the trend may be the key finding. Decide based on a model's assumptions and how a transformation changes interpretation.
Analyze and validate forecasts in time order
Define the question. Explaining change, finding unusual periods, and forecasting next month require different analyses. For a forecast, specify the target, forecast origin, and horizon.
Check the time index and quality: units, time zone, interval, missing or duplicated dates, and changes in measurement.
Plot the raw series. Inspect overall level, then year/month or weekday views to find calendar patterns, unusual values, and changing variance.
Set a simple baseline. A last-value forecast can be a reference when there is no clear seasonal pattern; a seasonal-naive forecast repeats the value from the same point in the previous cycle. Check whether a complex model improves on it.
Preserve chronology in validation. Train on an earlier span and evaluate on a later one. Rolling-origin validation moves the training cutoff forward and evaluates the future segment each time. Random splits can put future observations in training or mix trend and seasonal information, making performance look easier than deployment.
Match metrics to use. One-month and 12-month forecasts have different difficulty. Report errors by horizon and explain the metric: squared error is sensitive to outliers, while absolute error is expressed in the original unit.
This R example loads the documented data and inspects its time structure. It explores the series; it does not fit or validate a forecasting model.
data("AirPassengers")
frequency(AirPassengers) # 12 monthly observations per cycle
start(AirPassengers) # January 1949
plot(AirPassengers)
acf(AirPassengers)Keep interpretation within its limits
Movement together over time does not prove that one variable caused another. A seasonal pattern may coincide with holidays, pricing, supply limits, or a measurement change. A causal claim needs an appropriate design and additional evidence. Short histories, structural shifts, irregular spacing, and changes in data collection limit how reliable a pattern or forecast can be.
Record the date range, time zone, units, missing-value treatment, seasonal-period assumption, training and validation boundary, forecast horizon, baseline, and metric. This lets another analyst reproduce the result and check whether the pattern persists when data are updated.
References
[R documentation: AirPassengers data](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/AirPassengers.html)
[R documentation: `ts` time-series objects](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/ts.html)
[R documentation: autocorrelation function `acf`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/acf.html)
[Forecasting: Principles and Practice: time-series patterns](https://otexts.com/fpptr/tspatterns.html)
[Forecasting: Principles and Practice: time-series graphics](https://otexts.com/fpp3/graphics.html)
[Forecasting: Principles and Practice: decomposition](https://otexts.com/fpp3/decomposition.html)
[Forecasting: Principles and Practice: stationarity](https://otexts.com/fpptr/stationarity.html)
[Forecasting: Principles and Practice: time-series cross-validation](https://otexts.com/fpptr/tscv.html)