plot.STR
plots results of STR decomposition.
# S3 method for STR
plot(
x,
xTime = NULL,
dataPanels = 1,
predictorPanels = as.list(seq_along(x$output$predictors)),
randomPanels = length(x$output$predictors) + 1,
forecastPanels = length(x$output$predictors) + 2,
dataColor = "black",
predictorColors = rep("red", length(x$output$predictors)),
randomColor = "red",
forecastColor = "blue",
vLines = NULL,
xlab = "Time",
main = ifelse(x$method %in% c("STR", "STRmodel"), "STR decomposition",
"Robust STR decomposition"),
showLegend = TRUE,
...
)
Result of STR decomposition.
Times for data to plot.
Vector of panel numbers in which to plot the original data. Set to NULL
to not show data.
A list of vectors of numbers where every such vector describes which panels should be used for plotting the corresponding predictor.
Vector of panel numbers in which to plot the residuals. Set to NULL
to not show residuals.
Vector of panel numbers in which to plot the fit/forecast. Set to NULL
to not show forecasts.
Color to plot data.
Vector of colors to plot components corresponding to the predictors.
Color to plot the residuals.
Color to plot the fit/forecast.
Vector of times where vertical lines will be plotted.
Label for horizontal axis.
Main heading for plot.
When TRUE
(default) legend is shown at top of plot.
Other parameters to be passed directly to plot and lines functions in the implementation.
Alexander Dokumentov
STRmodel
, RSTRmodel
, STR
, AutoSTR
# \donttest{
fit <- AutoSTR(log(grocery))
plot(fit, forecastPanels = 0, randomColor = "DarkGreen", vLines = 2000:2010, lwd = 2)
# }
Run the code above in your browser using DataLab