
Calling Sequence


SeasonalSubseriesPlot(ts, opts)


Parameters


ts1



TimeSeries object

opts



(optional) equations of the form optionname = value, where optionname is one of means, starting_period, space, or seasonnames; or a general plot option





Options


•

means = false or a list of plot options


This option can be used to control the appearance of the horizontal line for the mean values per season. Setting means to false prevents the lines from showing up; other values are applied to the lines to set their color, thickness, and so on.

•

startingperiod = integer


By default, the time series is assumed to start with the first season. That is, the season containing the first data point is shown the furthest to the left, the one after that to its right, et cetera. If a monthly time series starts in, say, March, then it would probably be better to start with January instead. This is indicated by telling Maple that the time series starts with the 3rd period, by using the option startingperiod = 3. You can use negative numbers to count from the end; for example, startingperiod = 1 would be applicable if your monthly time series starts with December. It would be equivalent to startingperiod = 12 for monthly data. The default is startingperiod = 1.


This parameter controls a purely visual aspect of the resulting plot: the space between the line chart for one season and the one for the next. The line chart and the space together take up a horizontal width of $1$ unit; the space parameter specifies the fraction of this horizontal width used for space. The fraction should typically be nonnegative and less than one. The default value is $0.05$.

•

seasonnames = list or an expression


The names of the seasons are shown under the corresponding line charts, as tick marks on the axis. The default names are $''season\; 1'',''season\; 2''$, et cetera. This option can be used to specify a different name; either as a list of expressions to be used, or by specifying a single expression. If you specify a single expression, for example $''quarter''$, then it will be followed by a space and the season number, for example $''quarter\; 1'',''quarter\; 2'',\mathrm{...}$. If you specify a list, these are the names of the seasons, and they will be typeset as is.


If you specify an expression, it can be a typeset expression. If you specify a list, it can contain typeset expressions. To learn more about typesetting for plots, see plot/typeset.

•

color = list or range or color option


If you specify a single color, then the line charts will all get that color. If you specify a list of colors, then the colors in that list will be used for the line charts of subsequent data sets in the time series. If you specify a range of colors, the colors in that range will be used for the line charts of subsequent data sets in the time series.

•

Remaining options are passed to the plot command used for generating the line charts corresponding to the time series data, but not to the plot command for generating the horizontal lines for the seasonal means.



Description


•

The SeasonalSubseriesPlot command is used for displaying a plot of the seasonal subseries of a time series; that is, all values for a particular season are shown together. For example, for a monthly time series, this plot shows the January data points of all years together, the February data points, and so on. The seasons are shown next to each other.

•

Optionally, the plot also shows a horizontal line through each subseries, at the mean value for that season.

•

Typically, this command is used for time series having only a single data set, but it is possible to use it for time series having multiple data sets. In that case, the values of all data sets for a particular season are shown together.



Examples


>

$\mathrm{with}\left(\mathrm{TimeSeriesAnalysis}\right)\:$

Consider the following time series, which exhibits seasonal behavior with period 3.
>

$\mathrm{ts1}\u2254\mathrm{TimeSeries}\left(\left[4\,8\,9\,3\,8\,8\,5\,9\,10\,7\right]\,\mathrm{period}=3\right)$

${\mathrm{ts1}}{\u2254}\left[\begin{array}{c}{\mathrm{Time\; series}}\\ {\mathrm{data\; set}}\\ {\mathrm{10\; rows\; of\; data:}}\\ {\mathrm{2014\; \; 2023}}\end{array}\right]$
 (1) 
>

$\mathrm{TimeSeriesPlot}\left(\mathrm{ts1}\right)$

>

$\mathrm{SeasonalSubseriesPlot}\left(\mathrm{ts1}\right)$

You can color the lines of the means blue, and make the line charts for the time series thicker. You can also add a legend for the horizontal lines.
>

$\mathrm{SeasonalSubseriesPlot}\left(\mathrm{ts1}\,\mathrm{thickness}=3\,\mathrm{means}=\left[\mathrm{color}=''Niagara\; Blue''\,\mathrm{legend}=''seasonal\; mean''\right]\right)$

Consider the following monthly time series.
>

$\mathrm{ts2}\u2254\mathrm{TimeSeries}\left(\left[7\,23\,21\,19\,13\,46\,42\,30\,31\,26\,19\,9\,16\,26\,17\,33\,31\,46\,42\,35\,45\,30\,11\,17\,23\,20\,15\,36\,31\,55\,49\,39\,36\,28\,12\,11\,21\,23\,27\,33\,36\,49\,42\,37\,33\,45\,12\,7\,23\,32\,25\,42\,27\,52\,50\,34\,41\,40\,16\,14\right]\,\mathrm{frequency}=\mathrm{monthly}\,\mathrm{startdate}=''200509''\right)$

${\mathrm{ts2}}{\u2254}\left[\begin{array}{c}{\mathrm{Time\; series}}\\ {\mathrm{data\; set}}\\ {\mathrm{60\; rows\; of\; data:}}\\ {\mathrm{20050901\; \; 20100801}}\end{array}\right]$
 (2) 
>

$\mathrm{TimeSeriesPlot}\left(\mathrm{ts2}\right)$

>

$\mathrm{SeasonalSubseriesPlot}\left(\mathrm{ts2}\right)$

The time series starts in September; it makes sense to start the display with January. You can also specify the names of the months; then you need to make the plot a little wider so that all the names fit. And finally, you increase the space between the months in the plot.
>

$\mathrm{SeasonalSubseriesPlot}\left(\mathrm{ts2}\,\mathrm{startingperiod}=9\,\mathrm{seasonnames}=\left[''January''\,''February''\,''March''\,''April''\,''May''\,''June''\,''July''\,''August''\,''September''\,''October''\,''November''\,''December''\right]\,\mathrm{space}=0.25\,\mathrm{size}=\left[800\,400\right]\right)$



Compatibility


•

The TimeSeriesAnalysis[SeasonalSubseriesPlot] command was introduced in Maple 18.



