Given a large sequence of data $X$, what is the fastest method to check if:
1) $Var(X) = 0$
or
2) $Var(X) \neq 0$
Thanks.
Given a large sequence of data $X$, what is the fastest method to check if:
1) $Var(X) = 0$
or
2) $Var(X) \neq 0$
Thanks.
Copyright © 2021 JogjaFile Inc.
$Var(X)=0$ if and only if all data have the same value. Track min and max of the numbers you have already checked. When min $\ne$ max, you know $Var(X) > 0$.