book_3_75.m

Seasonal analysis

load carbondioxide

timeLabel = ['J'; 'F'; 'M'; 'A'; 'M'; 'J'; 'J'; 'A'; 'S'; 'O'; 'N'; 'D'];

% loess parameters for seasonal fit
period = length(timeLabel);
elShort = 25;
lambdaShort = 1;

seasonalPart = seasonaloess(Year,CO2,period,elShort,lambdaShort);

% Special plot to show seasonal component.
cycleplot(seasonalPart,period)
xlabel('Month')
ylabel('CO_2 (ppm)')
set(gca,'XTickLabel',timeLabel)
title('Seasonal Component of Monthly Average Carbon Dioxide')