otm.arXiv: Optimised Theta Method

otm.arxivR Documentation

Optimised Theta Method


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, ...)



Object of time series class


Number of required forecasting periods


If TRUE, the multiplicative seasonal decomposition is used. If NULL, quarterly and monthly time series are tested for statistically seasonal behaviour, with 95% of significance. Default is NULL.


The value of theta parameter. If theta = NULL the theta parameter is estimated using the Generalised Rolling Origin Evaluation.


A forecasting function for extrapolation the second theta-line. Default is expSmoot.


The error type that will be used by groe function for select the theta value in the estimation process. The possibility values for g is "sAPE", "APE", "AE" and "SE". If theta is not NULL the g argument is not used. Default is "sAPE".


The approach set-up for groe parameters (n1, m, H, p). One letter between 'a' to 'h' according to Fioruci et al (2015).


The first origin for Generalised Rolling Origin Evaluation. This argument is not used if theta!=NULL or approach!=NULL.


The number of movements of the origin in each step. This argument is not used if theta!=NULL or approach!=NULL.


The number of predictions in each step. This argument is not used if theta!=NULL or approach!=NULL.


The number of origin updates. This argument is not used if theta!=NULL or approach!=NULL.


A vector with the possible values for theta. This argument is not used if theta argument is not NULL.


Number of cores that will be used for estimate the theta parameter. It is not accepted mc.cores>1 on Windows SO.


Additional arguments for tLineExtrap.


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:


The original time series.


A time series element with the forecasting points.


A time series element with the fitted points.


A time series element with the residual points.


The estimated theta value.


The estimated parameters of tLineExtrap method.


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.

See Also

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) ###
#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] )
#mean( sAPE[646:1401, 1:8] )
#mean( sAPE[1402:2829, 1:18] )
### Other
#mean( sAPE[2830:3003, 1:8] )
### ALL
#mean( sAPE, na.rm=TRUE )

forecTheta documentation built on Nov. 12, 2022, 1:09 a.m.