[R-SIG-Finance] How to compare two asynchroneous xts time series?

Anass Mouhsine anass.mouhsine at gmail.com
Thu Jun 11 13:11:32 CEST 2009


Hi all,

Suppose I have two xts time series with asynchroneous time index.
I would like for example to calculate a ratio of those two series, but I 
don't know how to get an intersection of the two indices in order to 
avoid errors.

an example of the data is the following

series1

2008-06-02 09:00:00 5007.0
2008-06-02 09:01:00 5010.0
2008-06-02 09:02:00 5014.0
2008-06-02 09:03:00 5012.5
2008-06-02 09:04:00 5013.5
2008-06-02 09:05:00 5009.5
2008-06-02 09:06:00 5007.0
2008-06-02 09:07:00 5006.5
2008-06-02 09:08:00 5008.5
2008-06-02 09:09:00 5004.5

Series2

2008-06-02 09:01:00 7115.0
2008-06-02 09:03:00 7117.0
2008-06-02 09:05:00 7111.0
2008-06-02 09:07:00 7107.0
2008-06-02 09:09:00 7102.5

Any idea?

Thanks in advance



More information about the R-SIG-Finance mailing list