It might just be a matter of scaling: ts12s <- ts(c(scale(ts1), scale(ts2)), start = 1982, frequency = 12) plot(ts12s) plot(decompose(ts12s))
2008/3/31 Jędrzej Bojanowski <[EMAIL PROTECTED]>: > Dear Helpers, > > I am looking for methods and tools to compare and then to concatenate > two successive time series. They are both in the same frequency and they > describe one phenomena. There is no time gap between them. The problem > is that the method of measurements has changed between both time series > and they are no statistically the same. I would like to merge them to > receive one homogeneous time series. > > Here is an example of time series ts1 (1982-1999) and ts2 (2000-2006). > Zeros are NA's. > > > ts1 <- structure(c(100, 48, 31, 10, 16, 25, 56, 81, 51, 45, 73, 112, > 103, 60, 30, 21, 10, 26, 60, 55, 40, 46, 78, 125, 55, 21, 22, > 11, 13, 20, 38, 25, 17, 27, 49, 68, 40, 29, 44, 10, 21, 28, 58, > 71, 50, 68, 88, 38, 71, 37, 51, 11, 30, 30, 52, 59, 40, 47, 91, > 95, 62, 31, 44, 12, 27, 35, 36, 69, 32, 50, 81, 88, 72, 47, 28, > 20, 9, 15, 34, 38, 10, 18, 56, 124, 79, 26, 29, 9, 16, 21, 71, > 74, 52, 49, 80, 84, 52, 36, 37, 12, 21, 23, 70, 75, 69, 69, 81, > 66, 53, 26, 18, 12, 12, 11, 45, 60, 40, 39, 64, 80, 72, 30, 23, > 9, 18, 22, 53, 77, 45, 31, 54, 59, 26, 16, 14, 4, 4, 12, 20, > 21, 7, 13, 28, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 36, > 17, 18, 12, 28, 99, 90, 72, 69, 98, 78, 56, 31, 48, 11, 15, 31, > 70, 79, 67, 80, 107, 76, 43, 15, 29, 13, 17, 30, 70, 86, 52, > 35, 45, 93, 80, 49, 29, 16, 12, 23, 68, 80, 38, 52, 86, 94, 67, > 30, 14, 10, 14, 21, 35, 49, 33, 20, 39, 77), .Tsp = c(1982, > 1999.91666666667, > 12), class = "ts") > > > ts2 <- structure(c(0, 0, 0, 220, 72, 45, 45, 56, 60, 80, 81, 99, 97, > 92, 220, 141, 85, 40, 74, 115, 88, 97, 127, 107, 90, 86, 185, > 193, 100, 43, 45, 73, 74, 95, 87, 107, 77, 63, 163, 123, 106, > 35, 102, 122, 103, 96, 104, 140, 135, 87, 215, 173, 56, 38, 80, > 90, 113, 72, 86, 95, 88, 93, 198, 128, 40, 28, 76, 133, 80, 89, > 72, 108, 102, 86, 199, 204, 84, 60, 49, 103, 121, 98, 108, 165 > ), .Tsp = c(2000, 2006.91666666667, 12), class = "ts") > > When we plot them together the difference is visible: > > > ts12 <- ts(c(ts1,ts2),start=1982,frequency=12) > > plot(ts12) > > but > > plot(decompose(ts12)) > confirm that both describe one phenomena. > > I have dozens of such pairs and I would like to find a method to > recalculate one ts to the other to make one homogeneous ts. > > Do you have any suggestions how to statistically concatenate those two > ts or zoo (I tried this package) objects? Thanks in advance for the > answer and the precious time you might waste. > > Regards, > > Jedrzej > > ---------------------------------------------------- > PS. Włącz radio w Twoim komputerze! > Muzyka idealna do pracy i do zabawy! - Kliknij: > http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fradiokosci.html&sid=291 > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.