Determination of optimal test length to maximize the multiple correlation