Skip to content

covariance of equal date values

1 message · Scott, Uriel

#
Maybe try something along these lines:

Suppose the time series value vectors are x1 and x2 and the dates vectors
are
dates1 and dates2.

names(x1) <- dates1
names(x2) <- dates2

commonDates <- intersect( dates1 , dates2 )
desiredCovariance <- cov( x1[commonDates] , x2[commonDates] , use="c" )
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._