Is there a natural measure of "average distance from the real line"? Suppose I have a set $S$ of complex numbers such that if $z\in S$ has non-zero imaginary part, then its complex conjugate $z^* \in S$. (Such a set might arise, for example, as the set of eigenvalues of a real matrix.)
If I take the mean of the elements of $S$ then I get a real number. However, this throws away information about the imaginary part. I would like a quantity that measures the "average distance from the real line", i.e. a function of the set that goes to zero if all its members are real, and increases as the imaginary parts become larger.
Another version of this question would be if I had a random variable that takes on complex values, such that $p(z)=p(z^*)$ for all $z$. The expectation will always be real, but I'd like a nice conceptually clean way to measure the expected distance from the real line.
Of course I could use something like the root-mean-square of the numbers' imaginary parts, but that feels somehow arbitrary, so I'm wondering if there is a known function that serves this purpose, which arises naturally and has nice properties. I realise that's a rather vague set of requirements, but still I imagine that there will be at most one such function that exists in the literature.
 A: Well the RMS of the imaginary parts is exactly the standard deviation of the imaginary parts, since their mean is zero. If your eigenvalues are somehow coming from a random process and are also independent, you may want to use the unbiased version of the variance, though note that it won't give an unbiased estimator of the true standard deviation.
And I don't know anything about your kind of application, but in general a very robust measure of spread is the inter-quartile range, namely the distance between the 25% and 75% percentile. Unlike the sample standard deviation, the inter-quartile range is robust (with a 25% breakdown point) and even satisfies a form of the central limit theorem for any underlying distribution (ordinary CLT fails for Cauchy distribution).
A: You could consider the full covariance matrix of the real and imaginary parts. But the conjugation symmetry of $S$ means that this is a diagonal matrix, so it just tells you the variance of the real parts and the variance of the imaginary parts anyway. The square root of the latter is precisely the root-mean-square of the imaginary parts. In that way, it does arise naturally!
