test function for forecast