0
$\begingroup$

I am in need of Clarification about the Mean & Variance Stationary for time series data..

I was reading this discussion about the importance of Stationary https://stats.stackexchange.com/questions/253917/why-use-differencing-and-box-cox-in-time-series.. that @Michael R. Chernick clarify atmost that ARIMA model may need to model a Clean time series from Nonstationary in every aspects (which is Differencing and Box-Cox Transformations),

and later I want to apply forecasting with Prophet and ETS (Exponential Smoothing Space Model).. which this article helps give insight to do it https://mode.com/example-gallery/forecasting_prophet_r_cookbook/

I noticed that the article did apply only Box-Cox Transformation on data, and then do a inverse Box-Cox Transformation after the forecast applied.

So my question:

1) I recall using UKgas data from datasets library, this is the results of Dickey Fuller test after Box Cox Transformation

library(tseries)
library(forecast)
library(prophet)
library(datasets)
data(UKgas)
lambda <- BoxCox.lambda(na.contiguous(UKgas))
print(paste("Lambda = ", lambda))
"Lambda =  -0.445702282821823"

UKgas_transform_1 <- BoxCox(UKgas,lambda)
adf.test(UKgas_transform_1)

Augmented Dickey-Fuller Test

data:  UKgas_transform_1
Dickey-Fuller = -1.0813, Lag order = 4, p-value = 0.9218
alternative hypothesis: stationary

with high of p-values, the test implies that it may have unit root in the data after Box-Cox Transformations. So can this data be applied to other kind of forecast instead ARIMA?

2) if it cannot be applied, I may need to Difference the data again right? after the prediction done, so how to revert back the forecast data to actual data if I use both Differences and Box Cox Transformations?

Thank You in advance, Correct me also if my understanding are incorrect :)

$\endgroup$
1
$\begingroup$

You need to take difference of the transformed data, 'UKgas_transform_1' and then forecast.

After forecasting, you would get the stationary data. Since you took the difference of the transformed data, you have to do a cumulative sum of the forecast data

forecast_csum<- cumsum(forecast_data)

On the cumulative sum of the forecast data, you need to perform an Inverse Box-Cox Transform. The procedure for inverse Box-Cox transform is available in the same article that you have referred.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ what if I have a 2x difference on the dataset? should it be cumsum(cumsum(forecast_data))? $\endgroup$ – Jovan Geraldy Candra Apr 12 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.