added the AIC-optimal weighting routine due to Hansen (2007)