ATA {ATAforecasting} | R Documentation |
Automatic Time Series Analysis and Forecasting using Ata Method with Box-Cox Power Transformations Family and Seasonal Decomposition Techniques
Description
ATA
is a generic function for Ata Method forecasting.
The Ata method based on the modified simple exponential smoothing as described in Yapar, G. (2016) <doi:10.15672/HJMS.201614320580> ,
Yapar G., Capar, S., Selamlar, H. T., Yavuz, I. (2017) <doi:10.15672/HJMS.2017.493> and Yapar G., Selamlar, H. T., Capar, S., Yavuz, I. (2019)
<doi:10.15672/hujms.461032> is a new univariate time series forecasting method which provides innovative solutions to issues faced during
the initialization and optimization stages of existing methods.
Forecasting performance of the Ata method is superior to existing methods both in terms of easy implementation and accurate forecasting.
It can be applied to non-seasonal or seasonal time series which can be decomposed into four components (remainder, level, trend and seasonal).
This methodology performed well on the M3 and M4-competition data.
Usage
ATA(
X,
Y = NULL,
parP = NULL,
parQ = NULL,
parPHI = NULL,
model.type = NULL,
seasonal.test = NULL,
seasonal.model = "decomp",
seasonal.period = NULL,
seasonal.type = NULL,
seasonal.test.attr = NULL,
find.period = NULL,
accuracy.type = NULL,
nmse = 3,
level.fixed = FALSE,
trend.opt = "none",
h = NULL,
train_test_split = NULL,
holdout = FALSE,
holdout.adjustedP = TRUE,
holdout.set_size = NULL,
holdout.onestep = FALSE,
holdin = FALSE,
transform.order = "before",
transform.method = NULL,
transform.attr = NULL,
lambda = NULL,
shift = 0,
initial.level = "none",
initial.trend = "none",
ci.level = 95,
start.phi = NULL,
end.phi = NULL,
size.phi = NULL,
negative.forecast = TRUE,
onestep = FALSE,
print.out = TRUE,
plot.out = TRUE
)
Arguments
X |
A numeric vector or time series of class |
Y |
A numeric vector or time series of class |
parP |
Value of Level parameter |
parQ |
Value of Trend parameter |
parPHI |
Value of Damping Trend parameter |
model.type |
An one-character string identifying method using the framework terminology. The letter "A" for additive model, the letter "M" for multiplicative model.
If NULL, both letters will be tried and the best model (according to the accuracy measure |
seasonal.test |
Testing for stationary and seasonality. If TRUE, the method firstly uses |
seasonal.model |
A string identifying method for seasonal decomposition. If NULL, "decomp" method is default. c("none", "decomp", "stl", "stlplus", "tbats", "stR") phrases of methods denote
|
seasonal.period |
Value(s) of seasonal periodicity. If NULL, |
seasonal.type |
An one-character string identifying method for the seasonal component framework. The letter "A" for additive model, the letter "M" for multiplicative model.
If NULL, both letters will be tried and the best model (according to the accuracy measure |
seasonal.test.attr |
Attributes set for unit root, seasonality tests, X13ARIMA/SEATS and X11. If NULL, corrgram.tcrit=1.28, uroot.test="adf", suroot.test="correlogram", suroot.uroot=TRUE, uroot.type="trend", uroot.alpha=0.05, suroot.alpha=0.05, uroot.maxd=2, suroot.maxD=1, suroot.m=frequency(X), uroot.pkg="urca", multi.period="min", x13.estimate.maxiter=1500, x13.estimate.tol=1.0e-5, x11.estimate.maxiter=1500, x11.estimate.tol=1.0e-5. If you want to change, please use |
find.period |
Find seasonal period(s) automatically. If NULL, 0 is default. When
|
accuracy.type |
Accuracy measure for optimization of the best ATA Method forecasting. IF NULL,
|
nmse |
If accuracy.type == "AMSE" or "GAMSE", nmse provides the number of steps for average multistep MSE ('2<=nmse<=30'). |
level.fixed |
If TRUE, "pStarQ" –> First, fits ATA(p,0) where p = p* is optimized for q=0. Then, fits ATA(p*,q) where q is optimized for p = p*. |
trend.opt |
When
|
h |
The forecast horizon.
When the parameter is NULL; if the frequency of |
train_test_split |
If |
holdout |
Default is FALSE. If TRUE, ATA Method uses the holdout forecasting for accuracy measure to select the best model. In holdout forecasting, the last few data points are removed from the data series. The remaining historical data series is called in-sample data (training set), and the holdout data is called validation set (holdout set). If TRUE, holdout.set_size will used for holdout data. |
holdout.adjustedP |
Default is TRUE. If TRUE, parP will be adjusted by length of training - validation sets and in-sample set when the holdout forecasting is active. |
holdout.set_size |
If |
holdout.onestep |
Default is FALSE. if TRUE, the dynamic forecast strategy uses a one-step model multiple times ( |
holdin |
Default is FALSE. If TRUE, ATA Method uses the hold-in forecasting for accuracy measure to select the best model. In hold-in forecasting, the last h-length data points are used for accuracy measure. |
transform.order |
If "before", Box-Cox transformation family will be applied and then seasonal decomposition techniques will be applied. If "after", seasonal decomposition techniques will be applied and then Box-Cox transformation family will be applied. |
transform.method |
Transformation method –> "Box_Cox", "Sqrt", "Reciprocal", "Log", "NegLog", "Modulus", "BickelDoksum", "Manly", "Dual", "YeoJohnson", "GPower", "GLog". If the transformation process needs shift parameter,
|
transform.attr |
Attributes set for Box-Cox transformation. If NULL, bcMethod = "loglik", bcLower = 0, bcUpper = 1, bcBiasAdj = FALSE. If you want to change, please use |
lambda |
Box-Cox power transformation family parameter. Default is NULL. When "transform.method" is selected and lambda is set as NULL, required "lambda" parameter will be calculated automatically based on "transform.attr". |
shift |
Box-Cox power transformation family shifting parameter. Default is 0. When "transform.method" is selected, required shifting parameter will be calculated automatically according to dataset. |
initial.level |
"none" is default,
|
initial.trend |
"none" is default,
|
ci.level |
Confidence Interval levels for forecasting. |
start.phi |
Lower boundary for searching |
end.phi |
Upper boundary for searching |
size.phi |
Increment step for searching |
negative.forecast |
Negative values are allowed for forecasting. Default value is TRUE. If FALSE, all negative values for forecasting are set to 0. |
onestep |
Default is FALSE. if TRUE, the dynamic forecast strategy uses a one-step model multiple times ( |
print.out |
Default is TRUE. If FALSE, summary of ATA Method is not shown. |
plot.out |
Default is TRUE. If FALSE, graphics of ATA Method are not shown. |
Details
Returns ATA(p,q,phi)(E,T,S) applied to X
.
Value
Returns an object of class ata
. The generic accessor functions ATA.Forecast
and ATA.Accuracy
extract useful features of the value returned by ATA
and associated functions.
ata
object is a list containing at least the following elements
actual : The original time series.
fitted : Fitted values (one-step forecasts). The mean is of the fitted values is calculated over the ensemble.
level : Estimated level values.
trend : Estimated trend values.
residuals : Original values minus fitted values.
coefp : The weights attached to level observations.
coefq : The weights attached to trend observations.
p : Optimum level parameter.
q : Optimum trend parameter.
phi : Optimum damped trend parameter.
model.type: Form of trend.
h : The number of steps to forecast ahead.
forecast : Point forecasts as a time series.
out.sample: Test set as a time series.
method : The name of the optimum forecasting method as a character string for ATA(P,Q,PHI)(Error,Trend,Season).
initial.level : Selected initial level values for the time series forecasting method.
initial.trend : Selected initial trend values for the time series forecasting method.
level.fixed : A choice of optional level-fixed trended methods.
trend.opt : A choice of optional trend and level optimized trended methods (none, trend.fixed or trend.search).
transform.method : Box-Cox power transformation family method –> Box_Cox, Sqrt, Reciprocal, Log, NegLog, Modulus, BickelDoksum, Manly, Dual, YeoJohnson, GPower, GLog.
transform.order : Define how to apply Box-Cox power transformation techniques, before or after seasonal decomposition.
lambda : Box-Cox power transformation family parameter.
shift : Box-Cox power transformation family shifting parameter.
accuracy.type : Accuracy measure that is chosen for model selection.
nmse : The number of steps for average multistep MSE.
accuracy : In and out sample accuracy measures and its descriptives that are calculated for optimum model are given.
par.specs : Parameter sets for Information Criteria.
holdout : Holdout forecasting is TRUE or FALSE.
holdout.training : Training set in holdout forecasting.
holdout.validation: Validation set in holdout forecasting.
holdout.forecast : Holdout forecast.
holdout.accuracy : Accuracy measure chosen for model selection in holdout forecasting.
holdin : Hold-in forecasting is TRUE or FALSE.
is.season : Indicates whether it contains seasonal pattern.
seasonal.model : The name of the selected decomposition method.
seasonal.type : Form of seasonality.
seasonal.period : The number of seasonality periods.
seasonal.index : Weights of seasonality.
seasonal : Estimated seasonal values.
seasonal.adjusted : Deseasonalized time series values.
execution.time : The real and CPU time 'in seconds' spent by the system executing that task, including the time spent executing run-time or system services on its behalf.
calculation.time : How much real time 'in seconds' the currently running R process has already taken.
Author(s)
Ali Sabri Taylan and Hanife Taylan Selamlar
References
#'Yapar G, Yavuz I, Selamlar HT (2017). “Why and How Does Exponential Smoothing Fail? An In Depth Comparison of ATA-Simple and Simple Exponential Smoothing.” Turkish Journal of Forecasting, 1(1), 30–39.
#'Yapar G, Capar S, Selamlar HT, Yavuz I (2018). “Modified Holt's Linear Trend Method.” Hacettepe University Journal of Mathematics and Statistics, 47(5), 1394–1403.
#'Yapar G (2018). “Modified simple exponential smoothing.” Hacettepe University Journal of Mathematics and Statistics, 47(3), 741–754.
#'Yapar G, Selamlar HT, Capar S, Yavuz I (2019). “ATA method.” Hacettepe Journal of Mathematics and Statistics, 48(6), 1838-1844.
See Also
forecast
, stlplus
, stR
, stl
, decompose
,
tbats
, seasadj
, seasonal
.
Examples
trainATA <- head(touristTR, 84)
testATA <- window(touristTR, start = 2015, end = 2016.917)
ata_fit <- ATA(trainATA, h=24, parQ = 1, seasonal.test = TRUE, seasonal.model = "stl")
ata_fc <- ATA.Forecast(ata_fit, out.sample = testATA)
ata_accry <- ATA.Accuracy(ata_fc)