0
$\begingroup$

Am trying to forecast using time series method called ARIMA. I have followed steps to build a time series model displayed in the code below. My challenge is on (Merging Actual and Forecast in One Series) and Remove Transformation from Series.

salesData<- read.csv("C:/Users/sales.csv")

#converting data into time series
salesData<-ts(salesData,start = 2010, frequency = 4)

# Checking for stationarity
library(tseries)
adf.test(salesData)


# transforming data to stationary
ndiffs(salesData)
diff_series <- diff(salesData)
tsdisplay(diff_series)


## Augmented Dickey-Fuller Test for stationarity
adf.test(salesData)

# Arima forecasting auto generated, 1-step ahead
arimafore = forecast(auto.arima(salesData), h = 1)
summary(arimafore)
autoplot(arimafore,xlab="years", ylab="sales")

#Final forecasting after removing difference(transformation)
?????????

My question is how do i best Merge Actual and Forecast in One Series and then'transform' the forecast data 'back' so I can plot it along with the original time-series using Differencing method ?

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.