rewrote simex function for aggregate SGP