Optimal test length for maximum absolute prediction