search for: permute

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

Did you mean: permite
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.
2004 Jul 16
0
Permutations (summary)
...tation. In the last sentence intra-block permutations are those permutations which shuffle the first three numbers among themselves, the second three numbers among themselves, the third three numbers among themselves and the fourth three numbers among themselves. Numbers in one block cannot be permuted into another block through an intra-block permutation. (That would be an inter-block permutation.) For example, if we consider the following potential candidates as successive permutations the first is ok, the second is not since its an intra-block permutation of the first (thus the 2nd woul...
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 | 10 11 12 NO - - 3 2 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? Following
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,...
2007 Nov 16
4
Permutation of a distance matrix
...a32 a33 a31 a12 a13 a11 that is relative positions of rows and columns are conserved in the permutation. Basically, I have been doing this in a "for" loop by (1) permuting the raw data vector using "sample", (2) generating a lower triangular distance matrix from the permuted raw data using the "distance" function from "ecodist', and (3) calculating a bunch of statistics including the Mantel correlation and multiple regression statistics, which are then stored in blank matrices that were declared prior to beginning the loop. The whole procedure need...
2018 May 23
3
find the permutation function of a sorting
...quot;F"). 2018-05-23 11:06 GMT+08:00 David Winsemius <dwinsemius at comcast.net>: > > > > 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...
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.xensource.com/xen-devel
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...
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
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)
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
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") Each permutation must be 4
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 permuted at all)? I'm a little confused by how to code for a permutation test where I will have several subsets within the data that need to be mai...
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* package before *gregmisc* and when I load *e1071* after I load
2018 May 23
2
find the permutation function of a sorting
...he 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" I try to find it in the permutations/permute package, but I can't find it John [[alternative HTML version deleted]]
2010 Jan 28
2
Constrained vector permutation
Hello, I'm trying to permute a vector of positive integers > 0 with the constraint that each element must be <= twice the element before it (i.e. for some vector x, x[i] <= 2*x[i-1]), assuming the "0th" element is 1. Hence the first element of the vector must always be 1 or 2 (by assuming the "0th&quot...
2008 Nov 14
1
Generating unique permutations of a vector
...egies. As an example, if I assume the probability levels to be 0, 0.2, 0.4, 0.6, 0.8, 1, I can generate all possible probability distributions for the 5 types of offspring by using the following R-code: library(partitions) library(crank) n=5 P=parts(n) L=length(P[1,]) for (i in 1:L){ ma=unique(permute(P[,i])) if (i==1) m=ma else m=rbind(m,ma) } m=m/n > m [,1] [,2] [,3] [,4] [,5] [1,] 1.0 0.0 0.0 0.0 0.0 [2,] 0.0 1.0 0.0 0.0 0.0 [3,] 0.0 0.0 1.0 0.0 0.0 [4,] 0.0 0.0 0.0 1.0 0.0 [5,] 0.0 0.0 0.0 0.0 1.0 [6,] 0.8 0.2 0.0 0.0 0.0 [7,]...
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 effected i.e. per...
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 from these