Draws a line for point forecasts and adds shaded region for forecast distribution around it. This is added to a plot in the same way as
lines and polygon add lines and polygons to a plot.
apc.polygon(m.forecast,x.origin=1,
plot.se=TRUE,plot.se.proc=FALSE,plot.se.est=FALSE,
unit=1,
col.line=1,lty.line=1,lwd.line=1,
q.se=c(2,2,2),
angle.se=c(45,45,45),
border.se=c(NA,NA,NA),
col.se=gray(c(0.50,0.80,0.90)),
density.se=c(NULL,NULL,NULL),
lty.se=c(1,1,1))Matrix. Up to 4 columns. Column 1: point forecasts. Column 2: forecast standard errors. Column 3: process standard errors. Column 4: estimation standard errors.
Optional. Numerical. x-coordinate for last observation. The first point forecast is made at x.origin+unit, where unit (with default 1) is defined in apc.data.list. Default: 1.
Optional. Logical. Should forecast standard errors be plotted? Default: TRUE.
Optional. Logical. Should process standard errors be plotted? Default: FALSE.
Optional. Logical. Should estimation standard errors be plotted? Default: FALSE.
Optional. Numerical. step length for point forecasts. Default=1.
Optional. Point forecasts: Colour of line. Same as col for lines. Default: 1.
Optional. Point forecasts: Type of line. Same as lty for lines. Default: 1.
Optional. Point forecasts: Width of line. Same as lwd for lines. Default: 1.
Optional. Vector of length 3. Multiplication factors for standard errors. Default: c(2,2,2).
Optional. Standard error polygon: 3-vector: Angle of shading. Same as angle for polygon. Default: =c(45,45,45).
Optional. Standard error polygon: 3-vector: Border of polygon. Same as border for polygon. Default: =c(NA,NA,NA).
Optional. Standard error polygon: 3-vector: Colour of polygon. Same as col for polygon. Default: gray(c(0.50,0.80,0.90)).
Optional. Standard error polygon: 3-vector: Density of shading. Same as density for polygon. Default: =c(NULL,NULL,NULL).
Optional. Standard error polygon: 3-vector: Type of shading. Same as lty for polygon. Default: =c(1,1,1).
The empirical example of
Martinez Miranda, Nielsen and Nielsen (2015)
uses the data
data.asbestos.
The results of that paper are reproduced in
the vignette
ReproducingMMNN2015.pdf,
ReproducingMMNN2015.R
on
Vignettes.
The function is used there.
Martinez Miranda, M.D., Nielsen, B. and Nielsen, J.P. (2015) Inference and forecasting in the age-period-cohort model with unknown exposure with an application to mesothelioma mortality. Journal of the Royal Statistical Society A 178, 29-55. Download: Article, Nuffield DP.