math:variance   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

(define math:variance
   (lambda (lst)
      (let ((m (math:mean lst)))
   (let loop ((l lst)
        (v 0))
      (if (null? l)
    (/ v (length lst))
    (let ((var (- (car l) m)))
       (loop (cdr l) (+ v (* var var)))))))))


Back to Index