code: func (s Sample) Sum() float64 {
  	if s.Weights == nil {
  		return vec.Sum(s.Xs)
  	}
  	sum := 0.0
  	for i, x := range s.Xs {
  		sum += x * s.Weights[i]
  	}
  	return sum
  }
docs: // Sum returns the (possibly weighted) sum of the Sample.