Questions regarding BACK_TRANSFORMED, mean, median and SE in an ensemble with bootstrap forecasts for the LOG of a variable ly.
I can generate BOOTSTRAP forecasts for ly:
Code: Select all
declare vector[series] fcast_D(ndraws*2)
comp Nfcast_D = %rows(fcast_D)
declare vector[series] efcast_D(ndraws*2)
comp Nefcast_D = %rows(efcast_D)
do draw = 1, ndraws
boxjenk(noprint,constant,ar=||1||,diffs=1,ma=0,define=EnsembleEq,MAXL) ly istart iend
uforecast(equation=EnsembleEq,BOOTSTRAP) fore_D iend+1 iend+h
set fcast_D(draw) iend+1 iend+h = fore_D
set efcast_D(draw) iend+1 iend+h = exp(fore_D); * back-transformed median
end do draw
do draw = ndraws+1, (ndraws*2)
boxjenk(noprint,constant,ar=||1,2,3,4,5||,diffs=1,ma=0,define=EnsembleEq,MAXL) ly istart iend
uforecast(equation=EnsembleEq,BOOTSTRAP) fore_D iend+1 iend+h
set fcast_D(draw) iend+1 iend+h = fore_D
set efcast_D(draw) iend+1 iend+h = exp(fore_D); * back-transformed median
end do draw
prin / fcast_D efcast_DCode: Select all
set efcastMIN_D iend+1 iend+h = work=%xt(efcast_D,t),%fractiles(work,||.00||)(1); * 100%
....
set efcastmean_D iend+1 iend+h = work=%xt(efcast_D,t),%avg(work); * mean
set efcastmedian_D iend+1 iend+h = work=%xt(efcast_D,t),%fractiles(work,||.50||)(1); * median
....
set efcastMAX_D iend+1 iend+h = work=%xt(efcast_D,t),%fractiles(work,||1.00||)(1); * 100%The following calculates the MEAN's and SE's for the TRANSFORMED series ly:
Code: Select all
set acsum iend+1 iend+h = 0.0
set acsum_SS iend+1 iend+h = 0.0
do draw = 1, (ndraws*2)
set acsum iend+1 iend+h = acsum+fcast_D(draw)
set acsum_SS iend+1 iend+h = acsum_SS+(fcast_D(draw))^2
* save fcast_D(draw) in a cloud of simulations
dec vect[series] columns_D(ndraws*2)
set columns_D(draw) iend+1 iend+h = fcast_D(draw)
end do draw
prin / fcast_D columns_D; * same
set res_D_M iend+1 iend+h = acsum/(ndraws*2)
set res_D_MSS iend+1 iend+h = acsum_SS/(ndraws*2)
set res_D_SE iend+1 iend+h = sqrt(res_D_MSS-(res_D_M)^2)
prin / res_D_M res_D_SEhow do I calculate
(a) the same BACK-TRANSFORMED BIAS-ADJ MEAN: efcastmean_D?
(b) and the correct (aggregated) SE's: res_D_SE, for the TRANSFORMED series ly?
as
Code: Select all
set fmean_D iend+1 iend+h = exp(res_D_M) + 0.5*(res_D_SE**2.0)*exp(res_D_M)thanks,
Amarjit