[R] Calculate variance/covariance with complex numbers

Gang Chen gangchen6 at gmail.com
Sat Mar 27 18:04:12 CET 2010


Anybody knows what functions can be used to calculate
variance/covariance with complex numbers? var and cov don't seem to
work:

> a
                        1
V1 0.00810014+0.00169366i
V2 0.00813054+0.00158251i
V3 0.00805489+0.00163295i
V4 0.00809141+0.00159533i
V5 0.00813976+0.00161850i

> var(a)
             1
1 1.141556e-09
Warning message:
In var(a) : imaginary parts discarded in coercion

> cov(a)
             1
1 1.141556e-09
Warning message:
In cov(a) : imaginary parts discarded in coercion

Thanks in advance,
Gang



More information about the R-help mailing list