search for: permutation

Displaying 20 results from an estimated 1249 matches for "permutation".

Did you mean: permutations
2013 May 11
1
How to repeat 2 functions in succession for 400 times? (microarray data)
Hi, May be this helps: ?set.seed(24) ?mydata4<- as.data.frame(matrix(sample(1:100,10*38,replace=TRUE),ncol=38)) ?dim(mydata4) #[1] 10 38 ?library(matrixStats) res<-do.call(cbind,lapply(1:400, function(i) {permutation<-sample(mydata4); (rowMeans(permutation[,1:27])-rowMeans(permutation[,28:38]))/(rowSds(permutation[,1:27])+rowSds(permutation[,28:38]))} )) ?dim(res) #[1]? 10 400 A.K. >I want to do permutation test and then get a PGC score 400 times on mydata4 (microarray data) > >I use 2 functions...
2004 Jul 16
0
Permutations (summary)
Dear R users, This is a second summary of the permutation problem I previously posted. This summary restates the problem as well as the solution. First of all thanks to everyone including Erich, Robin, Gabor, Christian, Ingmar and others for your suggestions. With the help of an off-list discussion with Gabor I?m going to summarize. THE PROBLEM We...
2004 Jul 13
12
Permutations
Dear R users, I?m a beginner user of R and I?ve a problem with permutations that I don?t know how to solve. I?ve 12 elements in blocks of 3 elements and I want only to make permutations inter-blocks (no intra-blocks) (sorry if the terminology is not accurate), something similar to: 1 2 3 | 4 5 6 | 7 8 9 | 10 11 12 ----------1st permutation 1 3 2 | 4 5 6 | 7 8 9 | 1...
2004 Mar 10
3
aperm() and as.list() args to "["
Hi everyone. I'm playing with aperm(): a <- 1:24 dim(a) <- c(2,3,2,2) permutation <- c(1,2,4,3) b <- aperm(a,permutation) So if my understanding is right, a[1,3,2,1] == b[c(1,3,2,1)[permutation] ] but this isn't what I want because the RHS evaluates to a vector, and I am trying to identify a single element of b. How do I modify the RHS to give what I want? Fol...
2018 May 23
3
find the permutation function of a sorting
Thanks, David. I got the answer from the web. Is there any easy way to permute a set (e.g., a set of characters) by the permutation it returns? Thanks, > x <- c(10,7,4,3,8,2) > sort(x, index.return=TRUE) $x [1] 2 3 4 7 8 10 $ix [1] 6 4 3 2 5 1 2018-05-23 10:49 GMT+08:00 David Winsemius <dwinsemius at comcast.net>: > > > > On May 22, 2018, at 10:06 PM, John <miaojpm at gmail.com> wrote:...
2007 Nov 16
4
Permutation of a distance matrix
Hi there, I would like to find a more efficient way of permuting the rows and columns of a symmetrical matrix that represents ecological or actual distances between objects in space. The permutation is of the type used in a Mantel test. Specifically, the permutation has to accomplish something like this: Original matrix addresses: a11 a12 a13 a21 a22 a23 a31 a32 a33 Example permutation a22 a23 a21 a32 a33 a31 a12 a13 a11 that is relative positions of rows an...
2018 May 23
3
find the permutation function of a sorting
> sort(c("bc","ac","dd"), index.return=TRUE) $x [1] "ac" "bc" "dd" $ix [1] 2 1 3 We have the permutation, namely 1-->2, 2-->1, 3-->3. How can I apply the permutation function to a new set c("D","E", "F")? so that the result is c("E","D", "F"). 2018-05-23 11:06 GMT+08:00 David Winsemius <dwinsemius at comcast.net>: > &gt...
2008 Mar 18
6
[PATCH] permute with 2MB chunk
The memory permutation cause a slow down in case of a save/restore (bug 1143). It works better when the mixing is done with 2MB chunks. Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xenso...
2018 May 23
0
find the permutation function of a sorting
> On May 22, 2018, at 10:57 PM, John <miaojpm at gmail.com> wrote: > > Thanks, David. > I got the answer from the web. > Is there any easy way to permute a set (e.g., a set of characters) by the permutation it returns? Thanks, > > > > x <- c(10,7,4,3,8,2) > > sort(x, index.return=TRUE) > $x > [1] 2 3 4 7 8 10 > > $ix > [1] 6 4 3 2 5 1 > I don't understand what is being requested. The $ix value is the same as the one returned `by order`. David. &g...
2008 Apr 15
1
sign(<permutation>) in R ?
I am looking for an algorithm (written in R (preferably) or C, but even pseudo-code in a text book maybe fine) to determine the sign of a permutation. What is that? Well, a permutation is either even or odd, the sign is +1 or -1, respectively, see, e.g., http://en.wikipedia.org/wiki/Signature_of_a_permutation which also says >> In practice, in order to determine whether a given permutation >> is even or odd, one writes the per...
2006 Oct 23
1
Lmer, heteroscedasticity and permutation, need help please
Hi everybody, I'm trying to analyse a set of data with a non-normal response, 2 fixed effects and 1 nested random effect with strong heteroscedasticity in the model. I planned to use the function lmer : lmer(resp~var1*var2 + (1|rand)) and then use permutations based on the t-statistic given by lmer to get p-values. 1/ Is it a correct way to obtain p-values for my variables ? (see below) 2/ I read somewhere that lme is more adequate when heteroscedasticity is strong. Do I have to use lme instead of lmer ? 3/ It is possible to fit a glm in lmer using...
2009 Mar 14
2
permutations in R
Hi. Does anyone know of a function which will take as input a number n (or a set of n letters) and will give out, one at a time, the permutations of n (or of those n letters) as a vector? So that I can use the permutations one at a time. And such that it will exhaust all the permutations with no repeats. For example if n is 3, I would want a function which I could use in a loop and the first time I use it in the loop it may give the vector...
2009 Dec 18
2
Generating permutations that always include one specific element
Dear R community, I am trying to create a matrix of permutations of a vector: bands <- c("AL", "B", "DB", "DG", "G", "K", "LB", "LG", "MG", "O", "P", "PI", "PK", "PU", "R", "V", "W", "Y...
2008 Apr 02
0
Exact Permutation test
R users, Is it possible to do 'exact' permutation tests in R? If I run a perm.test or permutation.test.discrete on a data set that has, for example, 720 possible permutations, will that test permute ALL of those possible permutations, or will it just permute 720 random permutations (thus allowing some possibilities to repeat and some not to be per...
2011 Jan 24
2
Masking commands - Permutation in gregmisc and e1071
I am using the function permutations from the package *gregmisc*. However, I am also making use of the package *e1071*, which also contains a function called permutations. I want to use the function permutations from the * gregmisc* package, however, the other package is masking this function. This happens both when I load the *e1071...
2018 May 23
2
find the permutation function of a sorting
Hi, Is there any way to find the permutation function of the sorting and to apply the function (or its inverse) elsewhere? For example, the following permutation function from the sorting in the matrix form is c(1,2,3), c(2,1,3) > sort(c("bc","ac","dd")) [1] "ac" "bc" "dd"...
2010 Jan 28
2
Constrained vector permutation
.... Hence the first element of the vector must always be 1 or 2 (by assuming the "0th" element is 1). Similarly, the 2nd must always be below/= 4, the 3rd always below/= 6, etc. Here's an example, suppose I have the vector x x <- 2:6 This vector already fits the constraint, and a permutation such as x.good <- c(2,4,6,5,3) would also fit the constraint, but the vector x.bad1 <- c(4,6,5,3,2) does not work because of the 4 in the first position. The vector x.bad2 <- c(2,6,5,3,4) does not work because of the 6 in the second position. Does anyone know of a pre-made function...
2008 Nov 14
1
Generating unique permutations of a vector
...are identical, e.g. permute(c(1,0,0)) gives: [,1] [,2] [,3] [1,] 1 0 0 [2,] 1 0 0 [3,] 0 1 0 [4,] 0 0 1 [5,] 0 1 0 [6,] 0 0 1 In my above example, this means that permuting the first column of P, > P[,1] [1] 5 0 0 0 0 gives 5! = 120 permutations, although there are in fact only 5 unique ones, namely: 5 0 0 0 0 0 5 0 0 0 0 0 5 0 0 0 0 0 5 0 0 0 0 0 5 On my computer (Windows XP SP3, Pentium(R) 4 CPU 2.40GHz, 504 MB RAM - but I've also tried it on another computer with 1 GB RAM) this leads to the problem that as soon as the vector to b...
2009 Aug 14
1
Permutation test and R2 problem
Hi, I have optimized the shrinkage parameter (GCV)for ridge and got my r2 value is 70% . to check the sensitivity of the result, I did permutation test. I permuted the response vector and run for 1000 times and draw a distribution. But now, I get r2 values highest 98% and some of them more than 70 %. Is it expected from such type of test? *I was under impression that, r2 with real data set will always maximum! And permutation will not be e...
2002 Jan 16
2
exhaustive permutations
Hello R-help Readers I'm currently in the process of trying to write a permutation test procedure for looking at differences between groups with a multivariate data set (something equivalent to ANOSIM - analaysis of similarities for those familiar with this test). As with other permutation tests, for cases where there are large numbers of possible permutations, randomly sampling...