Skip to main content
added 70 characters in body
Source Link
Stephan Kolassa
  • 130.7k
  • 22
  • 264
  • 497

R has very good facilities for automatic time series forecasting, which I very much recommend. Here is what R does with your data, specifically an exponential smoothing model in state space form (ETS for "Error, Trend, Seasonality"):

library(forecast)

churn <- structure(c(0.9854712144, 1.000828964, 1.000828964, 1.000828964, 
1.004811044, 1.006802085, 1.006802085, 1.009788645, 1.009788645, 
1.013770726, 1.013770726, 1.015761766, 0.72113357, 0.7300932514, 
0.7346932411, 0.7406663621, 0.7565946846, 0.7585857249, 0.7625678056, 
0.7685409265, 0.7725230072, 0.7765050878, 0.7844692491, 0.7884513297, 
0.4732490503, 0.4890469254), .Tsp = c(2016.66666666667, 2018.75, 
12), class = "ts")

model_ets <- ets(churn)
plot(forecast(model_ets,h=12))

churn forecast

You get very reasonable point forecasts for the next 12 months, along with prediction intervals. You can also inspect the fitted model by typing model_ets. The title of the plot already tells you that you have an exponential smoothing model with multiplicative error, additive trend and additive seasonality. Makes sense to me. You could also allow ets() to automatically fit a Box-Cox transformation via ets(churn,lambda="auto").

However, the forecasts start looking weird once you forecast out 24 months (whether or not you use an automatic Box-Cox transformation) - they go below zero. So you may want to work on logged data here. It should in principle be possible to do so by using the parameters lambda=0,biasadj=TRUE in the call to ets(), but then ets() does not want to fit seasonality any more, and if you force seasonality by also specifying model="ZZA", you still get strange forecasts (specifically, they are offset from the last observation, which I don't fully understand), so you may want to log the data first, then feed them to ets(). Note that you need a bias transformation (look under "mathematical transformations" here) to get expectation forecasts.

An alternative is to use auto.arima(), but that one gives warnings generated by the unit root test because you have a rather short time series. If you have fewer than two seasonal cycles, ARIMA is a bit dubious, so I would stick with the simpler ETS models.

I very much recommend Forecasting: Principles and Practice by Hyndman & Athanasopoulos (2nd ed.), which is this free openfreely available online forecasting textbookhere, which. It uses R throughout.

R has very good facilities for automatic time series forecasting, which I very much recommend. Here is what R does with your data, specifically an exponential smoothing model in state space form (ETS for "Error, Trend, Seasonality"):

library(forecast)

churn <- structure(c(0.9854712144, 1.000828964, 1.000828964, 1.000828964, 
1.004811044, 1.006802085, 1.006802085, 1.009788645, 1.009788645, 
1.013770726, 1.013770726, 1.015761766, 0.72113357, 0.7300932514, 
0.7346932411, 0.7406663621, 0.7565946846, 0.7585857249, 0.7625678056, 
0.7685409265, 0.7725230072, 0.7765050878, 0.7844692491, 0.7884513297, 
0.4732490503, 0.4890469254), .Tsp = c(2016.66666666667, 2018.75, 
12), class = "ts")

model_ets <- ets(churn)
plot(forecast(model_ets,h=12))

churn forecast

You get very reasonable point forecasts for the next 12 months, along with prediction intervals. You can also inspect the fitted model by typing model_ets. The title of the plot already tells you that you have an exponential smoothing model with multiplicative error, additive trend and additive seasonality. Makes sense to me. You could also allow ets() to automatically fit a Box-Cox transformation via ets(churn,lambda="auto").

However, the forecasts start looking weird once you forecast out 24 months (whether or not you use an automatic Box-Cox transformation) - they go below zero. So you may want to work on logged data here. It should in principle be possible to do so by using the parameters lambda=0,biasadj=TRUE in the call to ets(), but then ets() does not want to fit seasonality any more, and if you force seasonality by also specifying model="ZZA", you still get strange forecasts (specifically, they are offset from the last observation, which I don't fully understand), so you may want to log the data first, then feed them to ets(). Note that you need a bias transformation (look under "mathematical transformations" here) to get expectation forecasts.

An alternative is to use auto.arima(), but that one gives warnings generated by the unit root test because you have a rather short time series. If you have fewer than two seasonal cycles, ARIMA is a bit dubious, so I would stick with the simpler ETS models.

I very much recommend this free open online forecasting textbook, which uses R throughout.

R has very good facilities for automatic time series forecasting, which I very much recommend. Here is what R does with your data, specifically an exponential smoothing model in state space form (ETS for "Error, Trend, Seasonality"):

library(forecast)

churn <- structure(c(0.9854712144, 1.000828964, 1.000828964, 1.000828964, 
1.004811044, 1.006802085, 1.006802085, 1.009788645, 1.009788645, 
1.013770726, 1.013770726, 1.015761766, 0.72113357, 0.7300932514, 
0.7346932411, 0.7406663621, 0.7565946846, 0.7585857249, 0.7625678056, 
0.7685409265, 0.7725230072, 0.7765050878, 0.7844692491, 0.7884513297, 
0.4732490503, 0.4890469254), .Tsp = c(2016.66666666667, 2018.75, 
12), class = "ts")

model_ets <- ets(churn)
plot(forecast(model_ets,h=12))

churn forecast

You get very reasonable point forecasts for the next 12 months, along with prediction intervals. You can also inspect the fitted model by typing model_ets. The title of the plot already tells you that you have an exponential smoothing model with multiplicative error, additive trend and additive seasonality. Makes sense to me. You could also allow ets() to automatically fit a Box-Cox transformation via ets(churn,lambda="auto").

However, the forecasts start looking weird once you forecast out 24 months (whether or not you use an automatic Box-Cox transformation) - they go below zero. So you may want to work on logged data here. It should in principle be possible to do so by using the parameters lambda=0,biasadj=TRUE in the call to ets(), but then ets() does not want to fit seasonality any more, and if you force seasonality by also specifying model="ZZA", you still get strange forecasts (specifically, they are offset from the last observation, which I don't fully understand), so you may want to log the data first, then feed them to ets(). Note that you need a bias transformation (look under "mathematical transformations" here) to get expectation forecasts.

An alternative is to use auto.arima(), but that one gives warnings generated by the unit root test because you have a rather short time series. If you have fewer than two seasonal cycles, ARIMA is a bit dubious, so I would stick with the simpler ETS models.

I very much recommend Forecasting: Principles and Practice by Hyndman & Athanasopoulos (2nd ed.), which is freely available online here. It uses R throughout.

Source Link
Stephan Kolassa
  • 130.7k
  • 22
  • 264
  • 497

R has very good facilities for automatic time series forecasting, which I very much recommend. Here is what R does with your data, specifically an exponential smoothing model in state space form (ETS for "Error, Trend, Seasonality"):

library(forecast)

churn <- structure(c(0.9854712144, 1.000828964, 1.000828964, 1.000828964, 
1.004811044, 1.006802085, 1.006802085, 1.009788645, 1.009788645, 
1.013770726, 1.013770726, 1.015761766, 0.72113357, 0.7300932514, 
0.7346932411, 0.7406663621, 0.7565946846, 0.7585857249, 0.7625678056, 
0.7685409265, 0.7725230072, 0.7765050878, 0.7844692491, 0.7884513297, 
0.4732490503, 0.4890469254), .Tsp = c(2016.66666666667, 2018.75, 
12), class = "ts")

model_ets <- ets(churn)
plot(forecast(model_ets,h=12))

churn forecast

You get very reasonable point forecasts for the next 12 months, along with prediction intervals. You can also inspect the fitted model by typing model_ets. The title of the plot already tells you that you have an exponential smoothing model with multiplicative error, additive trend and additive seasonality. Makes sense to me. You could also allow ets() to automatically fit a Box-Cox transformation via ets(churn,lambda="auto").

However, the forecasts start looking weird once you forecast out 24 months (whether or not you use an automatic Box-Cox transformation) - they go below zero. So you may want to work on logged data here. It should in principle be possible to do so by using the parameters lambda=0,biasadj=TRUE in the call to ets(), but then ets() does not want to fit seasonality any more, and if you force seasonality by also specifying model="ZZA", you still get strange forecasts (specifically, they are offset from the last observation, which I don't fully understand), so you may want to log the data first, then feed them to ets(). Note that you need a bias transformation (look under "mathematical transformations" here) to get expectation forecasts.

An alternative is to use auto.arima(), but that one gives warnings generated by the unit root test because you have a rather short time series. If you have fewer than two seasonal cycles, ARIMA is a bit dubious, so I would stick with the simpler ETS models.

I very much recommend this free open online forecasting textbook, which uses R throughout.