Josué Polanco
2010-Jun-22 10:53 UTC
[R] replication time series using permutations of the each "y" values
Dear All, I'm trying to create this: I've these data (a, b,c, etc. are numbers) : 1 a b 2 c d f 3 g 4 h ... N I'm trying to create the all "time series permutations" (length = N) taking account the possibilities for each value. For example (N=4), 1 a 2 c 3 g 4 h next, 1 b 2 c 3 g 4 h next 1 a 2 d 3 g 4 h and so on. For this example, there are 2*3 different (possibilities) time series, but I need to do, v. gr., N = 100, and 2^14 different (possibilities) time series. I am wondering if somebody could give me a hint (suggestion) to make this using a function in R. thank you so much best regards -- Josue Polanco
Joris Meys
2010-Jun-22 15:58 UTC
[R] replication time series using permutations of the each "y" values
Read the posting guide please. What's your data structure? That's quite important. As I see it, I can easily get a matrix with what you want by : x1 <- rep("a","b",each=3) x2 <- rep("c","d","f",times=2) x3 <- rep("g",6) x4 <- rep("h",6) result <- rbind(x1,x2,x3,x4) But that's not what you want probably. Cheers Joris 2010/6/22 Josu? Polanco <jomopo at gmail.com>:> Dear All, > > I'm trying to create this: > I've these data (a, b,c, etc. are numbers) : > > 1 ?a b > 2 ?c d f > 3 ?g > 4 ?h > ? ... > N > > I'm trying to create the all "time series permutations" (length = N) > taking account > the possibilities for each value. For example (N=4), > > 1 ?a > 2 ?c > 3 ?g > 4 ?h > > next, > 1 ? b > 2 ? c > 3 ? g > 4 ? h > > next > 1 ? a > 2 ? d > 3 ? g > 4 ? h > > and so on. For this example, there are 2*3 different (possibilities) > time series, but > I need to do, v. gr., N = 100, and 2^14 ?different (possibilities) > time series. I am wondering > if somebody could give me a hint (suggestion) to make this using a > function in R. > > thank you so much > > best regards > > -- > Josue Polanco > > ______________________________________________ > R-help at 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. >-- Joris Meys Statistical consultant Ghent University Faculty of Bioscience Engineering Department of Applied mathematics, biometrics and process control tel : +32 9 264 59 87 Joris.Meys at Ugent.be ------------------------------- Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php