Inverting logarithmic output from VAR model I'm working on a VAR model and am doing a log transformation of the raw data. 
x = log(x)

After differencing, running various tests and running a VAR(2) model, I add the predicted differences cumulatively to the original time series (logged) like this:
prd.diffs <- as.ts(prd$mean$d.x1)
U <- tail(undiff,2)
cumu <- cumsum(prd.diffs) + U[1]

However, while the output now looks as it should, it is still in logged values.
My question is as follows:
How does one return the logged output to original values? I'm under the impression that using exp() will not give the correct results, and having tried some variations it hasn't worked for me. 
Does the fact that it is a VAR($p$) model (and possibly what lag it has) influence the method, and how should that be implemented to get the correct output?
P.S. I realise that the above code does not constitute a replicable example as I didn't deem that necessary for the question, but should that be desired I can add some more code.
 A: The actual question seems to be, if one has an optimal (say, in mean-square sense) forecast $\widehat{\log(x)}$ of $\log(x)$, is $e^{\widehat{\log(x)}}$ an optimal forecast of $x$?
The answer is generally no.
Here is Dave Giles' excellent blog post "More on Prediction From Log-Linear Regressions" explaining the issue and suggesting a remedy -- the smearing estimator of Duan (1983) (the details are a little tedious but they are explained very well in the said blog post). 
In a special case where the errors in the model for $\log(x)$ are normally distributed, the optimal (in mean-square sense) prediction of $x$ is
$$ \hat x^* = e^{\widehat{\log(x)}} + \frac{\hat\sigma^2}{2} $$
where $\hat\sigma^2$ is an unbiased estimator of error variance from the model for $\log(x)$. However, this result is sensitive to normality and should be used with care.
Now the good news for an applied forecaster: there is some evidence that empirically the simple way of exponentiating the prediction $\widehat{\log(x)}$ may be superior to using the formula given above for the case of Normal errors -- once specification and estimation uncertainty are taken into account; see Bårdsen & Lütkepohl (2011).
References


*

*Duan, N., 1983. Smearing estimate: A nonparametric retransformation method. Journal of the American Statistical Association, 78, 605-610.

*Bårdsen, G., and H. Lütkepohl, 2011. Forecasting levels of log variables in vector autoregressions. International Journal of Forecasting, 27, 1108-1115.

