Trends and Seasonalities
The number of airline passengers in years 1949 to 1960 was increasing but also varied seasonally. Apply MovingMap with Total over non-overlapping yearly windows to visualize annual growth. Use DateHistogram for monthly data with yearly date reduction to study seasonal dependencies.
The number of international airline passengers per month in years 1949 to 1960 is available via ExampleData.
data = ExampleData[{"Statistics", "InternationalAirlinePassengers"},
"TimeSeries"]
The data exhibits both a long-term increasing trend and seasonal oscillations.
DateListPlot[data, PlotTheme -> "Detailed"]
Aggregate yearly to see the global trend. Place the aggregated results at the last day of each year to make the 1-year moving windows non-overlapping.
positionspec = {{1949, 12, 31}, {1960, 12, 31}, Quantity[1, "Year"]};
mm = MovingMap[Total,
data, {Quantity[1, "Years"], Right, positionspec}];
DateListPlot[mm, PlotMarkers -> Automatic,
GridLines -> {mm["Dates"], None}]
Analyze seasonal dependence. Create WeightedData with number of passengers as weights for the dates.
wd = WeightedData[data["Dates"], data["Values"]];
DateHistogram aggregates the weights for each month over the years as specified by DateReduction.
DateHistogram[wd, "Month", DateReduction -> "Year"]