Inverse differencing and inverse box cox on forecasted arima predictions I am working on a time series project with non-seasonal data which has a non-constant variance. So in order to solve that issue I used box cox transformation to get the data in a suitable format,

data %>%
  BoxCox(lambda) %>%
  autoplot()

data1 = data %>%
  BoxCox(lambda) 

then I observed that first order differencing made the data stationery, so I fitted the following arima model to the data..
model <- stats::arima(data1, order = c(3,1,4), method="ML")

After which I did my forecasting using the following function:
modelforecast = forecast::forecast(model, h=10)

now i need to get the data back in the original scale, so I did the following process:
boxinvTransform <- function(y, lambda) {
  if (lambda == 0L) { log(y) }
  else { (y^lambda - 1) / lambda }
}

invdiff = diffinv(modelforecast$mean, differences = 1)
forecast_ = boxinvTransform(invdiff, lambda)


But the results that I got are nowhere near the scale of the original data...
original data: 456800 397800 383700 501900 417100 454100 434000 403700 566500 472200 445800 496500 523800 549600
the data that i got after the above mentioned process:  -Inf 0.9434329 1.3769624 1.5894133 1.7242389 1.8205814 1.8943596 1.9534444 2.0023330 2.0437477 2.0794921
What am I missing? Any help will be appreciated.

Your "inverse transform" is actually identical to the Box-Cox transform. So you are applying the transformation twice.
The correct inverse transformation would be
boxinvTransform <- function(y, lambda) {
  if (lambda == 0L) { exp(y) }
  else { (y * lambda + 1)^(1/lambda) }
}

But you are obviously already using the forecast package which includes the BoxCox() function. It also includes the InvBoxCox() function, so you can just use that.
Even easier, use the built-in transformations in the package which handles it all for you, like this:
model <- Arima(data, order = c(3,1,4), lambda = lambda)
modelforecast <- forecast(model, h=10)

The resulting forecasts will be back-transformed as required.
