[R] covariance of equal date values

Scott, Uriel uriel.scott at mirant.com
Tue Feb 26 19:47:21 CET 2002


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" )



> -----Original Message-----
> From:	Lukas Kubin [SMTP:lukas.kubin at permonik.com]
> Sent:	Tuesday, February 26, 2002 5:16 AM
> To:	r-help at stat.math.ethz.ch
> Subject:	[R] covariance of equal date values
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I need to count the covariance of two time series. Both of them contain
> the dates' vector and vector of values. But the dates are not the same. It
> means some dates of first ts are not in the second respectively. And I
> need the covariance of same dates, of course.
> Could anyone help me, please?
> Thank you.
> 
> lukas
> 
> - -- 
> Lukas Kubin
> lukas.kubin at permonik.com
> phone: 00420603836180
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.5 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE8e2B14TIZ2lmUAtsRAi3AAJ0Sd7G8MkFMPmdmfhBxDFcHo4CjaQCgjcLZ
> bbVG0SM5cMYKk497WJzsAe8=
> =N1KE
> -----END PGP SIGNATURE-----
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> _._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list