On Wed, 17 Jul 2019, Yusuf Abduwahab Hassan wrote:
Good morning all,
Please how can i re-transform the forecasts of the estimations in
log-transformed data back to levels form?
Assuming that
- you want to forecast vie conditional expectation (ie with quadratic loss)
- your data are at least approximately normal
you can compute the expectation of the exponential as
E(exp(x)) = exp(E(x) + 0.5*v(x))
An example script with out-of-sample forecast on the famous Box-Jenkins
"airline" dataset follows
<hansl>
open bjg.gdt --quiet
series insample = t < "1960:3"
series f = NA
smpl insample == 1 --restrict
arima 0 1 1 ; 0 1 1 ; lg
fcast --out-of-sample
matrix F = $fcast + 0.5 * $fcse.^2
smpl insample == 0 --restrict --replace
f = exp(F)
setinfo f --graph-name="forecast"
smpl full
gnuplot g f --time-series --with-lines --output=display
</hansl>
Hope this helps.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------