otm.arxiv | R Documentation |
Functions for forecast univariate time series using the Optimised Theta Method presented in the arxiv paper (Fioruci et al, 2015). If the theta parameter is not specified so the Generalised Rolling Origin Evaluation is used for select the theta value over the thetaList argument.
otm.arxiv( y, h=5, s=NULL, theta=NULL, tLineExtrap=expSmoot, g="sAPE", approach="c", n1=NULL, m=NULL, H=NULL, p=NULL, thetaList=seq(from=1,to=5,by=0.5), mc.cores=1, ...)
y |
Object of time series class |
h |
Number of required forecasting periods |
s |
If |
theta |
The value of theta parameter. If |
tLineExtrap |
A forecasting function for extrapolation the second theta-line. Default is |
g |
The error type that will be used by |
approach |
The approach set-up for |
n1 |
The first origin for Generalised Rolling Origin Evaluation.
This argument is not used if |
m |
The number of movements of the origin in each step. This argument is not used if |
H |
The number of predictions in each step. This argument is not used if |
p |
The number of origin updates. This argument is not used if |
thetaList |
A vector with the possible values for |
mc.cores |
Number of cores that will be used for estimate the theta parameter. It is not accepted |
... |
Additional arguments for |
These functions are fully automatic, you just need to pass your time series. Particular cases are obtained by:
If theta = 1
the tLineExtrapModel
method is computed;
If theta = 2
so the Standard Theta Method of Assimakopoulos and Nikolopoulos (2000) is computed.
By default (s=NULL
), the 90% significance seasonal Z-test, used by Assimakopoulos and Nikolopoulos (2000), is applied for quarterly and monthly time series.
An list containing the elements:
$y |
The original time series. |
$mean |
A time series element with the forecasting points. |
$fitted |
A time series element with the fitted points. |
$residuals |
A time series element with the residual points. |
$theta |
The estimated theta value. |
$tLineExtrap_par |
The estimated parameters of |
$weights |
The estimated weights values. |
The thetaM
function is just a particular case of otm
with theta=2
.
Jose Augusto Fiorucci, Francisco Louzada
Fioruci J.A., Pellegrini T.R., Louzada F., Petropoulos F. (2015). The Optimised Theta Method. arXiv preprint, arXiv:1503.03529.
Assimakopoulos, V. and Nikolopoulos k. (2000). The theta model: a decomposition approach to forecasting. International Journal of Forecasting 16, 4, 521-530.
forecTheta-package
, dotm
, groe
y1 = 2+ 0.15*(1:20) + rnorm(20,2) y2 = y1[20]+ 0.3*(1:30) + rnorm(30,2) y = as.ts(c(y1,y2)) otm.arxiv(y, h=10) ### running the M3-competition data base by OTM approach (a) ### #require(Mcomp) #data(M3) # #forec = matrix(NA, nrow=3003, ncol=18) #obs = matrix(NA, nrow=3003, ncol=18) #matrix of the out-sample values # #for(i in 1:3003){ # if(i %% 100 == 0){print(i)} # x=M3[[i]]$x # h=M3[[i]]$h # out = otm.arxiv(x,h,approach='a',tLineExtrap=ses) # forec[i,1:h] = out$mean # obs[i,1:h] = M3[[i]]$xx #} # #sAPE = errorMetric(obs, forec, type="sAPE", statistic="N") ## sAPE matrix # ##### sMAPE results ## ### Yearly #mean( sAPE[1:645, 1:6] ) ### QUARTERLY #mean( sAPE[646:1401, 1:8] ) ### MONTHLY #mean( sAPE[1402:2829, 1:18] ) ### Other #mean( sAPE[2830:3003, 1:8] ) ### ALL #mean( sAPE, na.rm=TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.