plot
in Package x12 ~~plot-methods.Rd
Plot function for x12
output in package x12.
# S4 method for x12Single
plot(x, original=TRUE, sa=FALSE, trend=FALSE, log_transform=FALSE,
ylab="Value", xlab="Date", main="TS", col_original="black", col_sa="blue",
col_trend="green", lwd_original=1, lwd_sa=1, lwd_trend=1, lty_sa=1, lty_trend=1, ytop=1,
showAllout=FALSE, showAlloutLines=FALSE, showOut=NULL, annComp=TRUE, annCompTrend=TRUE,
col_ao="red", col_ls="red", col_tc="red", col_annComp="grey", lwd_out=1, cex_out=1.5,
pch_ao=4, pch_ls=2, pch_tc=23, plot_legend=TRUE, legend_horiz=TRUE, legend_bty="o",
forecast=FALSE, backcast=FALSE,
showCI=TRUE, col_fc="#2020ff", col_bc="#2020ff", col_ci="#d1d1ff",
col_cishade="#d1d1ff", lty_original=1, lty_fc=2, lty_bc=2, lty_ci=1, lwd_fc=1, lwd_bc=1,
lwd_ci=1, points_bc=FALSE, points_fc=FALSE, points_original=FALSE, showLine=FALSE,
col_line="grey", lty_line=3, ylim=NULL, span=NULL, ...)
# S4 method for x12Batch
plot(x, what="ask",original=TRUE, sa=FALSE, trend=FALSE, log_transform=FALSE,
ylab="Value", xlab="Date", main="TS", col_original="black", col_sa="blue",
col_trend="green", lwd_original=1, lwd_sa=1, lwd_trend=1, lty_sa=1, lty_trend=1, ytop=1,
showAllout=FALSE, showAlloutLines=FALSE, showOut=NULL, annComp=TRUE, annCompTrend=TRUE,
col_ao="red", col_ls="red", col_tc="red", col_annComp="grey", lwd_out=1, cex_out=1.5,
pch_ao=4, pch_ls=2, pch_tc=23, plot_legend=TRUE, legend_horiz=TRUE, legend_bty="o",
forecast=FALSE, backcast=FALSE,
showCI=TRUE, col_fc="#2020ff", col_bc="#2020ff", col_ci="#d1d1ff",
col_cishade="#d1d1ff", lty_original=1, lty_fc=2, lty_bc=2, lty_ci=1, lwd_fc=1, lwd_bc=1,
lwd_ci=1, points_bc=FALSE, points_fc=FALSE, points_original=FALSE, showLine=FALSE,
col_line="grey", lty_line=3, ylim=NULL, span=NULL, ...)
# S4 method for x12Output
plot(x, original=TRUE, sa=FALSE, trend=FALSE, log_transform=FALSE,
ylab="Value", xlab="Date", main="TS", col_original="black", col_sa="blue",
col_trend="green", lwd_original=1, lwd_sa=1, lwd_trend=1, lty_sa=1, lty_trend=1, ytop=1,
showAllout=FALSE, showAlloutLines=FALSE, showOut=NULL, annComp=TRUE, annCompTrend=TRUE,
col_ao="red", col_ls="red", col_tc="red", col_annComp="grey", lwd_out=1, cex_out=1.5,
pch_ao=4, pch_ls=2, pch_tc=23, plot_legend=TRUE, legend_horiz=TRUE, legend_bty="o",
forecast=FALSE, backcast=FALSE, showCI=TRUE,
col_fc="#2020ff", col_bc="#2020ff", col_ci="#d1d1ff", col_cishade="#d1d1ff",
lty_original=1, lty_fc=2, lty_bc=2, lty_ci=1, lwd_fc=1, lwd_bc=1, lwd_ci=1,
points_bc=FALSE, points_fc=FALSE, points_original=FALSE,
showLine=FALSE, col_line="grey", lty_line=3, ylim=NULL, span=NULL, ...)
<!-- %plot(x,y,...) -->
signature(x = "x12Output")
signature(x = "x12Single")
object of class x12Output-class
or x12Single-class
.
logical defining whether the original time series should be plotted.
logical defining whether the seasonally adjusted time series should be plotted.
logical defining whether the trend should be plotted.
logical defining whether the log transform should be plotted.
logical defining whether all outliers should be plotted.
character in the format "TypeYear.Seasonalperiod"
defining a specific outlier to be plotted.
logical defining whether an annual comparison should be performed for the outlier defined in showOut
.
logical defining whether the forecasts should be plotted.
logical defining whether the backcasts should be plotted.
logical defining whether the prediction intervals should be plotted.
label of y-axis.
label of x-axis.
plot title.
color of the original time series.
color of the seasonally adjusted time series.
color of the trend.
line width of the original time series.
line width of the seasonally adjusted time series.
line width of the trend.
line type of the original time series.
line type of the seasonally adjusted time series.
line type of the trend.
multiplication factor for ylim
.
logical specifying if vertical lines should be plotted with the outliers.
logical specifying if the trend of the annual comparison should be plotted.
color of additive outliers.
color of level shifts.
color of transitory changes.
color of annual comparison.
line width of outliers.
magnification factor for size of symbols used for plotting outliers.
symbols used for additive outliers.
symbols used for level shifts.
symbols used for transitory changes.
logical specifying if a legend should be plotted.
Orientation of the legend
the type of box to be drawn around the legend. The allowed values are "o" (the default) and "n".
color of forecasts.
color of backcasts.
color of prediction interval.
color of prediction interval shading.
line type of forecasts.
line type of backcasts.
line type of prediction interval.
line width of forecasts.
line width of backcasts.
line width of prediction interval.
logical specifying if backcasts should additionally be indicated with points.
logical specifying if forecasts should additionally be indicated with points.
logical specifying if the original time series should additionally be indicated with points.
logical indicating if a boundary line should be drawn before/after fore-/backcasts.
color of showLine
.
line type of showLine
.
range of the y-axis.
vector of length 4, limiting the data used for the plot.
Start and end date of said time interval can be specified by 4 integers in the format c(start year, start seasonal period, end year, end seasonal period)
How multiple plots should be treated. "ask" is the only option at the moment.
ignored.
if (FALSE) {
s <- new("x12Single",ts=AirPassengers,tsName="air")
s <- setP(s,list(estimate=TRUE,regression.variables="AO1950.1",outlier.types="all",
outlier.critical=list(LS=3.5,TC=2.5),backcast_years=1/2))
s <- x12(s)
#w/o outliers
plot(s@x12Output,sa=TRUE,trend=TRUE,original=FALSE)
plot(s)
#with (all) outliers
plot(s,showAllout=TRUE,sa=TRUE,trend=TRUE,log_transform=TRUE,lwd_out=1,pch_ao=4)
plot(s,showAllout=TRUE,sa=TRUE,trend=TRUE,original=FALSE,showAlloutLines=TRUE,
col_tc="purple")#,log_transform=TRUE)#,lwd_out=3)
plot(s,showAllout=TRUE,span=c(1951,1,1953,12),points_original=TRUE,cex_out=2)
#with showOut
plot(s,showOut="AO1960.Jun",sa=FALSE,trend=FALSE,annComp=TRUE,log_transform=TRUE)
plot(s,showOut="AO1958.Mar",sa=TRUE,trend=TRUE,annComp=TRUE,annCompTrend=FALSE)
plot(s,showOut="AO1950.Jun",annComp=FALSE,cex_out=3,pch_ao=19,col_ao="orange")
plot(s,showOut="TC1954.Mar",span=c(1954,1,1955,12))
plot(s,showOut="TC1954.Feb",col_tc="green3")
#w/o legend
plot(s,showAllout=TRUE,plot_legend=FALSE)
plot(s,plot_legend=FALSE)
plot(s,showOut="AO1950.1",plot_legend=FALSE,lwd_out=2,col_ao="purple")
plot(s,showOut="TC1954.Feb",col_tc="orange",col_ao="magenta",plot_legend=FALSE)
plot(s,showOut="AO1950.1",col_tc="orange",col_ao="magenta",plot_legend=FALSE)
#Forecasts & Backcasts
plot(s,forecast=TRUE)
plot(s,backcast=TRUE,showLine=TRUE)
plot(s,backcast=TRUE,forecast=TRUE,showCI=FALSE)
plot(s,forecast=TRUE,points_fc=TRUE,col_fc="purple",lty_fc=2,lty_original=3,
lwd_fc=0.9,lwd_ci=2)
plot(s,sa=TRUE,plot_legend=FALSE)
#Seasonal Factors and SI Ratios
plotSeasFac(s)
#Spectra
plotSpec(s)
plotSpec(s,highlight=FALSE)
#Autocorrelations of the Residuals
plotRsdAcf(s)
plotRsdAcf(s,col_acf="black",lwd_acf=1)
}