## Forecast averaging

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Katjes
Posts: 55
Joined: Thu Oct 02, 2008 5:46 am

### Forecast averaging

My forecasts are recursively estimated. Therefore, I think it is reasonable to adjust the training sample for forecast averaging.
Is there an easy command to do this:

Code: Select all

`for %weight mse ranks  smpl 2013.1 2018.1GDP.forcavg(name=test_{%weight}, wgttype={%weight},trainsmpl="2010Q1 2012Q4") GDP_f*next`

Or do I need to average every period individually with a loop over training sample? e.g. adjusting the training sample for every new forecast quarter?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12419
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Forecast averaging

I'm not sure I understand the question.

Katjes
Posts: 55
Joined: Thu Oct 02, 2008 5:46 am

### Re: Forecast averaging

I now solved the issue with a loop, but was wondering whether there is a more suitable solution:

Code: Select all

`'flexible training period"genr mse_fix=NAgenr mse_all=NAfor !ii=0 to 31smpl 2011q1+!ii 2011q1+!ii%train_fix="2011q1+"+@str(!ii)+"-8 2011q1+"+@str(!ii)+"-1"  ''' fixed evaluation mse sample%train_all="2011q1-1 2011q1+"+@str(!ii)+"-1" 'expanding evaluation mse smplgdp.forcavg(name=test_a, wgttype=mse, trainsmpl={%train_fix}) gdp_f1 gdp_f2mse_fix=test_agdp.forcavg(name=test_b, wgttype=mse, trainsmpl={%train_all}) gdp_f1 gdp_f2mse_all=test_bnext`