Page 2 of 2
Re: Ensemble with bootstrap forecasts for a transformed vari
Posted: Mon Jul 31, 2023 4:36 pm
by TomDoan
ac_1 wrote:TomDoan wrote:Re (2). No. It's not a mixture distribution. Mixture has a specific meaning which I've explained. Equal averaging is (a).
(3). Compute using the training sample. It's a single methodology which can be applied to any method of computing and combining forecasts. And no. In general there is no other way. Standard errors of a linear combination require the covariances which in general don't exist from the estimation of the models.
Thanks. I can do (1), and (3) Var(aX+bY) for a Normal, haven't attempted a Log-Normal or a Non-Central Chi-Squared.
The question is how to generate a mixture x% from model A and (1-x%) from model B: and forecast (i) analytically and (ii) bootstrapped?
var(aX+bY)=a^2 var(X)+2ab cov(X,Y)+b^2 var(Y) regardless of the distribution of X and Y. The issue is that you don't have cov(X,Y). The calculations in the Enders example are all based upon (in some form) the empirical distribution of the forecast errors during the training sample (2000:3 to 2012:4). If you do a weighted forecast, you can compute an estimate of the standard errors of forecast by computing...the standard errors of the weighted forecast over the training period. While you *can* compute an estimate of the variance of the forecasts by computing the full covariance matrix of the forecast errors and computing the variance of a linear combination using that, you can use the method of just computing statistics on forecast errors using any method of producing a forecast.
Why would you want a probabilistic mixture of A and B? You aren't estimating models that way. You want averages, not mixtures. Stop confusing the two.
Re: Ensemble with bootstrap forecasts for a transformed vari
Posted: Tue Aug 01, 2023 2:56 am
by ac_1
Agreed. I will try the other 2: Log-Normal, Non-Central Chi Squared...
Mixture distributions are able to capture a wide variety of complex distributions. Forecasting macro and financial variables and consistently being
'successful' year-on-year is extremely difficult

, although that's not say it can't be done. Generating a sample from distribution A, and a sample from distribution B,
may or may not be a better way to capture these complex dynamics. Either way, I'd like to know how in RATS.
Re: Ensemble with bootstrap forecasts for a transformed vari
Posted: Tue Aug 01, 2023 9:51 am
by TomDoan
Mixture models are covered in the User's Guide:
https://estima.com/docs/RATS%2010%20Use ... f#page=396
Note, and note well: having a single DGP, but not being sure of which of a number of plausible models is somehow "best" is completely different conceptually and statistically from having a process with several possible DGP's with some random process governing which is in effect at a given time period. (The latter being much, much more complicated).
Re: Ensemble with bootstrap forecasts for a transformed vari
Posted: Thu Aug 03, 2023 4:52 am
by ac_1
Mixture Models are in the Users Guide UG-378, the index states Mixture models, UG-386.
I think I want bootstrap forecasts from models M1 and M2, and then boot the entries to generate the 'mixture' vect[series] fcast_M3. But there's NA's in fcast_M3 various entries iend+1 iend+h -- strangely if I run the code
again they all get filled with booted values from the 2 vect[series] fcast_M1 and fcast_M2! Also, it ought to be x% from fcast_M1 and (1-x%) from fcast_M2?
Code: Select all
comp ndraws = 500
do draw = 1, ndraws
boxjenk(noprint,constant,ar=||1||,diffs=1,ma=0,define=Eq_M1,MAXL) ALTSALES istart iend resids_M1
uforecast(equation=Eq_M1,BOOTSTRAP) fore_M1 iend+1 iend+h
set fcast_M1(draw) iend+1 iend+h = fore_M1
boxjenk(noprint,constant,ar=||1,2,3,4,5||,diffs=1,ma=0,define=Eq_M2,MAXL) ALTSALES istart iend resids_M2
uforecast(equation=Eq_M2,BOOTSTRAP) fore_M2 iend+1 iend+h
set fcast_M2(draw) iend+1 iend+h = fore_M2
boot entries iend+1 iend+h 1 ndraws
set fcast_M3(draw) iend+1 iend+h = fcast_M1(entries)
boot entries iend+1 iend+h 1 ndraws
set fcast_M3(draw) iend+1 iend+h = fcast_M2(entries)
end do draw
prin / fcast_M1 fcast_M2 fcast_M3
Re: Ensemble with bootstrap forecasts for a transformed vari
Posted: Thu Aug 03, 2023 8:25 am
by TomDoan
I have no idea what you are trying to do. Note that your second SET on fcast_m3 completely overwrites the first one. Why is "mixture" in quotes?
If you are trying to do an average (which is it seemed like you were doing before getting sidetracked with incorrect terminology), it's very simple: take the average of the m1 and m2 draws:
set fcast_M3(draw) iend+1 iend+h = .5*(fcast_M1+fcast_m2)
You don't have to shuffle entries (that was already done in bootstrapping the M1 and M2 forecasts)