Plot Method for Decomposition Results in the Style of Base R Plots
Plot Method for Decomposition Results in the Style of Base R Plots
This is method for producing various plots of the decomposition results returned by this package.
## S4 method for signature 'decomp'plot(x, which =NULL,...)
Arguments
x: an object returned by the function deseats.
which: various plots can be selected either via a keyword or a number; enter "facets" or 1 to show a facet plot of the estimated time series components; enter "observations" or 2 to show the input time series; enter "fitted" or 3 to show the observations alongside the estimated trend with seasonality; enter "detailed_fit" or 4 to show the observations together with the fitted values and the trend; enter "trend_season" or 5 to show the observations together with the trend and with the seasonality (the latter shown around the series mean); enter "residuals" or 6 to plot the both detrended and seasonally adjusted series; use 7 or "deseasonalized" to show the seasonally adjusted series; enter 8 or "detrended" to plot the detrended series; the default is which = NULL which then lets you select a plot interactively in the R console.
...: further arguments to pass to plot.ts or matplot (depending on whether only one time series or multiple time series are shown in the plot).
Returns
A graphic is created in the plots windows, the function itself, however, returns NULL.
Details
Create predefined standard plots of the decomposition objects returned by the deseats package, e.g. returned by the function deseats. Plots are created in the base R plot style. The type of plot can be chosen either interactively from the console, or the argument which can be used to directly select the kind of plot to create (see also the description of the argument which) within the function call.
If plot type 5 (which = 5) is selected, the estimated seasonality will be displayed around the mean of the observations by default. Setting the additional argument s_around to some other value, will lead to the seasonality being displayed around that constant value.
Examples
Xt <- log(EXPENDITURES)est <- deseats(Xt)plot(est, which =3)
Author(s)
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn University),