Zero variance

I noticed today that by using complex numbers you can create a set of values whose variance is zero, even though not all the numbers are equal.

Let X be a set of real numbers. Let Y be a set of complex numbers evenly spaced along the circle whose center is at mean(X) and whose radius is stdev(X). Y doesn't have to have the same number of points as X. In fact, you can even take the limit and let Y be the set of all points on the circle. Here's a picture of what I'm talking about, where X is the set {0..10}:

The mean of Y will be equal to the mean of X, but the variance and standard deviation of Y will be 0. Furthermore, the variance of the real components of Y (ignoring the imaginary components) is equal to half the variance of X.

It would be even more interesting if you could define Y so that its real components were exactly the same as the real components of X. However in the case where X consists of two points, this require the imaginary components of Y to be +/- infinity, so I'm suspicious.

I'm not sure whether this kind of thing is actually useful or not, but it does at least provide an interesting interpretation of the meaning of variance. The fact that the variance of the real part of Y is proportional to the variance of X also makes me wonder whether there's a connection here to the idea of marginal distributions.

Here's a bit of scheme code that shows what I'm talking about.

(define pi 3.14159265358979323846)

(define (curry f x) 
  (lambda y (apply f x y)))

(define (n-downto-0 x)
  (if (= 0 x) '(0) (cons x (n-downto-0 (sub1 x)))))

;; returns a list of all the n-th roots of x
(define (roots x n)
  (map (lambda (i) (make-polar (* x (expt 1 (/ 1 n)))
                               (* 2 pi (/ i n))))
       (n-downto-0 (sub1 n))))

(define (avg vals)
  (/ (apply + vals) (length vals)))

(define (variance vals)
  (let ((mean (avg vals)))
    (avg (map (lambda (x) (sqr (- x mean))) vals))))

(define X (n-downto-0 100))
(define Y (map (curry + (avg X)) 
               (roots (sqrt (variance X)) (length X))))

(variance X)
(variance Y)
(* 2 (variance (map real-part Y)))

Posted on March 11, 2007 09:17 PM
More math articles

Comments

I'm sure it's more useful to define variance in terms of

1/(n-1) * Sum[i=1,..,n] |x_i-mean(x)|^2

in the complex case as well.

Posted by: M at March 12, 2007 05:26 AM

Well sure, but that's no fun. By "useful", you seem to mean "more practical, given the mental habits I've developed over the years". The point of my post was that if you let the math guide you where it wants to, then you can find interesting things.

Posted by: Kim at March 12, 2007 11:34 AM

Wiki says: use the conjugate transpose: http://en.wikipedia.org/wiki/Covariance_matrix#Complex_random_vectors

Posted by: Daniel at March 18, 2007 04:02 PM

By multiplying a complex number by its conjugate, you just force it back onto the real line. It's basically the same as taking the absolute value, as M suggested.

Posted by: Kim at March 18, 2007 06:04 PM

Fair enough. But generally results about real numbers that apply to complex numbers require using conjugates. e.g., double-roots for polynomials are only double-roots when they are real--when the numbers are complex, you get two roots that are conjugates: http://en.wikipedia.org/wiki/Complex_conjugate_root_theorem

So I think that "letting the math guide you" leads you to the conjugates, at least in the broader context of results for complex numbers.

On a random note, i! = 0.498015668 - 0.154949828 i (courtesy of Google Calculator).

Posted by: Daniel at March 28, 2007 09:32 AM
Post a comment









Remember info?




Prove you're human. Type "human":