From: Luna Moon on 18 Feb 2010 14:58 Let's say you have TS1 and TS2, two time series objects. They have different length and different dates, how do I align them (i.e. make the data fall on same dates...)? We could take the intersection of the dates ... Thanks a lot!
From: ade77 on 18 Feb 2010 15:38 Luna Moon <lunamoonmoon(a)gmail.com> wrote in message <18f014cd-4b0f-4ed5-ac08-17da05e57436(a)y26g2000vbb.googlegroups.com>... > Let's say you have TS1 and TS2, two time series objects. > > They have different length and different dates, how do I align them > (i.e. make the data fall on same dates...)? > > We could take the intersection of the dates ... > > Thanks a lot! if you want the concurrent values, one approach is to convert your timeseries back to regular array, use the intersect function to find the common dates, then convert back to timeseries. if they are different time sample entirely, and you want them to be aligned one way or the other , then you might want to interpolate one or the other, and apply an offset. Everything will depend on the theory behind what you are doing. if you need more explaination, let me know.
From: dpb on 18 Feb 2010 16:20 Luna Moon wrote: > Let's say you have TS1 and TS2, two time series objects. > > They have different length and different dates, how do I align them > (i.e. make the data fall on same dates...)? > > We could take the intersection of the dates ... You basically only have two choices -- either accept the subset that has coincident dates or interpolate. Interpolation could be select one to match the other, interpolate both to fill in missing in other or interpolate both to fit some other arbitrary spacing. Which to choose and how to implement would be terribly dependent on purpose and type of data as well as (relative) sparsity, etc., etc., etc., ... --
From: Oleg Komarov on 18 Feb 2010 17:28 Luna Moon <lunamoonmoon(a)gmail.com> wrote in message <18f014cd-4b0f-4ed5-ac08-17da05e57436(a)y26g2000vbb.googlegroups.com>... > Let's say you have TS1 and TS2, two time series objects. > > They have different length and different dates, how do I align them > (i.e. make the data fall on same dates...)? > > We could take the intersection of the dates ... > > Thanks a lot! I manage financial timeseries without rvolving to timeseries objects. If I have lets say weekly data I align all returns to friday and then use my Pivot (FEX). the final result would look like this: NaN 1.00 2.00 734167.00 0.10 NaN 734174.00 0.28 NaN 734181.00 0.55 0.96 734188.00 NaN 0.96 Where 1 and 2 are the IDs of the series and the first column are serial dates... Oleg
|
Pages: 1 Prev: replace values in a cell with nan Next: Button Up/Down Function |