python - variance vs coefficient of variation -
i need identify statistic let me find on digital image line has highest variation. using variance (square units, calculated numpy.var(x)) , coefficient of variation (unitless, calculated numpy.sd(x)/numpy.mean(x)), got different values, here:
v1 = line(var(x))
v2 = line(cv(x))
print(v1,v2)
(12,17)
should not both find same line? 1 better use in case?
coefficient of variation , variance not supposed choose same array on random data. coefficient of variation sensitive both variance , scale of data, whereas variance geared towards variation in data.
please see example:
import numpy np x = np.random.randn(10) x1= x+10 np.var(x), np.std(x)/np.mean(x) (2.0571740850649021, -2.2697110381499224) np.var(x1), np.std(x1)/np.mean(x1) (2.0571740850649016, 0.1531035017615747)
which 1 choose depends on application, i'm leaning towards variance in case.
Comments
Post a Comment