Skip to main content
deleted 61 characters in body
Source Link
Ferdi
  • 5.3k
  • 10
  • 47
  • 64

I am working on an alogorithm in R to automatize a monthly forecast calculation. I am using, among others, the ets() function from the forecast package to calculate forecast. It is working very well.

Unfortunately, for some specific time series, the result I get is weird.

Please, find below the code i am using :

train_ts<- ts(values, frequency=12)
fit2<-ets(train_ts, model="ZZZ", damped=TRUE, alpha=NULL, beta=NULL, gamma=NULL, 
            phi=NULL, additive.only=FALSE, lambda=TRUE, 
            lower=c(0.0001,0.0001,0.0001,0.8),upper=c(0.9999,0.9999,0.9999,0.98), 
            opt.crit=c("lik","amse","mse","sigma","mae"), nmse=3, 
            bounds=c("both","usual","admissible"), ic=c("aicc","aic","bic"),
            restrict=TRUE)  
ets <- forecast(fit2,h=forecasthorizon,method ='ets')   

Please, you will find below the concerned history data set :

 values <- c(27, 27, 7, 24, 39, 40, 24, 45, 36, 37, 31, 47, 16, 24, 6, 21, 
35, 36, 21, 40, 32, 33, 27, 42, 14, 21, 5, 19, 31, 32, 19, 36, 
29, 29, 24, 42, 15, 24, 21)

Here, on the graph, you will see the historical data (black), the fitted value (green) and the forecast(blue). The forecast is definitely not in lines with the fitted value.

Do you have any idea on how to "bound" the forecat to be "in line" with the historical sales? Thank you very very much for your kind help.

Best regards.enter image description here

I am working on an alogorithm in R to automatize a monthly forecast calculation. I am using, among others, the ets() function from the forecast package to calculate forecast. It is working very well.

Unfortunately, for some specific time series, the result I get is weird.

Please, find below the code i am using :

train_ts<- ts(values, frequency=12)
fit2<-ets(train_ts, model="ZZZ", damped=TRUE, alpha=NULL, beta=NULL, gamma=NULL, 
            phi=NULL, additive.only=FALSE, lambda=TRUE, 
            lower=c(0.0001,0.0001,0.0001,0.8),upper=c(0.9999,0.9999,0.9999,0.98), 
            opt.crit=c("lik","amse","mse","sigma","mae"), nmse=3, 
            bounds=c("both","usual","admissible"), ic=c("aicc","aic","bic"),
            restrict=TRUE)  
ets <- forecast(fit2,h=forecasthorizon,method ='ets')   

Please, you will find below the concerned history data set :

 values <- c(27, 27, 7, 24, 39, 40, 24, 45, 36, 37, 31, 47, 16, 24, 6, 21, 
35, 36, 21, 40, 32, 33, 27, 42, 14, 21, 5, 19, 31, 32, 19, 36, 
29, 29, 24, 42, 15, 24, 21)

Here, on the graph, you will see the historical data (black), the fitted value (green) and the forecast(blue). The forecast is definitely not in lines with the fitted value.

Do you have any idea on how to "bound" the forecat to be "in line" with the historical sales? Thank you very very much for your kind help.

Best regards.enter image description here

I am working on an alogorithm in R to automatize a monthly forecast calculation. I am using, among others, the ets() function from the forecast package to calculate forecast. It is working very well.

Unfortunately, for some specific time series, the result I get is weird.

Please, find below the code i am using :

train_ts<- ts(values, frequency=12)
fit2<-ets(train_ts, model="ZZZ", damped=TRUE, alpha=NULL, beta=NULL, gamma=NULL, 
            phi=NULL, additive.only=FALSE, lambda=TRUE, 
            lower=c(0.0001,0.0001,0.0001,0.8),upper=c(0.9999,0.9999,0.9999,0.98), 
            opt.crit=c("lik","amse","mse","sigma","mae"), nmse=3, 
            bounds=c("both","usual","admissible"), ic=c("aicc","aic","bic"),
            restrict=TRUE)  
ets <- forecast(fit2,h=forecasthorizon,method ='ets')   

Please, you will find below the concerned history data set :

 values <- c(27, 27, 7, 24, 39, 40, 24, 45, 36, 37, 31, 47, 16, 24, 6, 21, 
35, 36, 21, 40, 32, 33, 27, 42, 14, 21, 5, 19, 31, 32, 19, 36, 
29, 29, 24, 42, 15, 24, 21)

Here, on the graph, you will see the historical data (black), the fitted value (green) and the forecast(blue). The forecast is definitely not in lines with the fitted value.

Do you have any idea on how to "bound" the forecat to be "in line" with the historical sales? enter image description here

Tweeted twitter.com/#!/StackStats/status/589805999315353601
edited tags
Link
forecaster
  • 8.7k
  • 10
  • 51
  • 87
ETS() function, how to avoid forecast not in line with historical data ?
Link

How ETS() function, how to avoid sky high calculated forecast from ets()not in line with historical data?

deleted 119 characters in body
Source Link
mpiktas
  • 35.4k
  • 6
  • 89
  • 145
Loading
Rollback to Revision 1
Source Link
Tim
  • 141.2k
  • 26
  • 270
  • 512
Loading
deleted 119 characters in body
Source Link
mpiktas
  • 35.4k
  • 6
  • 89
  • 145
Loading
added 190 characters in body
Source Link
Tim
  • 141.2k
  • 26
  • 270
  • 512
Loading
Source Link
mehdik
  • 181
  • 1
  • 1
  • 3
Loading