Solved by harsha_g in post #2 
              
              
                You are taking mean in the numerator and denominator separately instead of taking the mean after l2/l1. In other words, mean(l1/l2) is not mean(l1)/mean(l2)