The following function estimates MAPA and produces out-of-sample forecasts.
It is not suggested, unless only simple single origin forecasts are required.
In sample observations of a time series (vector). If y == "paper" then
it prints paper reference.
ppy
Periods in a season of the time series at the sampled frequency.
If insample is a ts object then this is taken from its frequency, unless overriden.
fh
Forecast horizon. Default = ppy.
minimumAL
Lowest aggregation level to use. Default = 1, maximumAL>1.
maximumAL
Highest aggregation level to use. Default = ppy.
comb
Combination operator. One of "mean" or "median". Default is "mean"
output
Type of output. One of "forecast" or "all". Default is "forecast". If output="all",
both forecasts and components estimates per aggregation level are provided.
paral
Use parallel processing. 0 = no; 1 = yes (requires initialised cluster); 2 = yes
and initialise cluster. Default is 0.
display
Display calculation progress in console. 0 = no; 1 = yes. Default is 0.
outplot
Provide output plot. 0 = no; 1 = time series and forecast only; 2 = time series, forecasts and components. For the components the rainbow colouring scheme is used. Red is aggregation level 1, followed by yellow, green, cyan, blue and magenta for the higher aggregation levels. Default is 1.
hybrid
Provide hybrid forecasts, as in Kourentzes et al. paper. If minimumAL > 1 then the minimumAL ETS forecasts are used. Default is TRUE.
model
Allow only that type of ETS at each aggregation level. This follows similar coding to the ets function. The first letter refers to the error type ("A", "M" or "Z"); the second letter refers to the trend type ("N","A","Ad","M","Md" or "Z"); and the third letter refers to the season type ("N","A","M" or "Z"). The letters mean: "N"=none, "A"=additive, "M"=multiplicative and "Z"=automatically selected. A "d" for trend implies damped. By default model="ZZZ". If due to sample limitation ETS cannot be calculated at an aggregation level for the selected model, then no estimation is done for that specific level. For aggregation levels that seasonality becomes 1 then a non-seasonal model is estimated.
Value
forecasts
Vector with forecasts.
components
Array with MAPA components, if output="all".
Author(s)
Nikolaos Kourentzes and Fotios Petropoulos
References
Kourentzes N., Petropoulos F., Trapero J.R., 2014. Improving forecasting by estimating time
series structural components across multiple frequencies, International Journal of Forecasting,
30(2), 291-302.
See Also
mapa.
Examples
mapasimple(admissions)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MAPA)
Loading required package: forecast
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Loading required package: timeDate
This is forecast 7.1
Loading required package: parallel
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MAPA/mapasimple.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mapasimple
> ### Title: MAPA Single Origin Forecast Wrapper
> ### Aliases: mapasimple
> ### Keywords: ~mapa
>
> ### ** Examples
>
> mapasimple(admissions)
t+1 t+2 t+3 t+4 t+5 t+6 t+7 t+8
458732.6 448279.9 451533.9 463749.2 459251.6 469736.7 459595.3 443381.3
t+9 t+10 t+11 t+12
473877.6 456717.7 460672.0 455979.3
>
>
>
>
>
> dev.off()
null device
1
>