sparse_var function

Calculate variance from sparse vectors