similar to: permutation of the rows of a matrix that minimizes the distance to another matrix

Displaying 20 results from an estimated 20000 matches similar to: "permutation of the rows of a matrix that minimizes the distance to another matrix"

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)
2017 Jun 21
0
Permutations in RDA for repeated measures, using how()
Dear all, I am using RDA to study plant communities in various land uses (variable LU with values M, U, etc.). For each land use, I sample 3 to 5 fields (M1, M2, U1, U2, etc). I make 5 measurements for both plant communities and environmental variables in each field. I repeat the process every 6 months to study the effect of time and season (D16 for dry season 2017, R16 for rainy season 2016,
2011 Dec 20
1
column permutation of sparse matrix
Hi, I'm very new to working with sparse matrices and would like to know how I can column permute a sparse matrix. Here is a small example: > M1 <- > spMatrix(nrow=5,ncol=6,i=sample(5,15,replace=TRUE),j=sample(6,15,replace=TRUE),x=round_any(rnorm(15,2),0.001)) > M1 5 x 6 sparse Matrix of class "dgTMatrix" [1,] 2.983 . 1.656 5.003 . . [2,] .
2011 Dec 03
1
partial mantel tests in ecodist with intential NA values.
I would like to perform partial mantel tests on only within group values, with "between group" values assigned to NA. This is possible in package ncf partial.mantel.test, however this sues a different permutation to that used in ecodist.ecodist will not accept data with NA values, returning a "matrix is not square error. is it possible to perform this test in ecodist? many thanks
2013 Jun 14
2
significance testing for the difference in the ratio of means
I have a question regarding significance testing for the difference in the ratio of means. The data consists of a control and a test group, each with and without treatment. I am interested in testing if the treatment has a significantly different effect (say, in terms of fold-activation) on the test group compared to the control. The form of the data with arbitrary n and not assuming equal
2009 Dec 20
2
Remove rows in a matrix that match rows in another matrix
Dear R Community, The following seems like a simple problem, but I''ve been stuck on it for some time, with no luck using matching or subsetting functions. I''m trying to remove the rows from a large matrix that match rows in another large matrix. A (small scale) example: col1<-c("A", "B", "C", "D") col2<-c("A",
2013 Sep 23
0
Correlate rows of 2 matrices
Hi, You may try: set.seed(49) m1 = matrix(rnorm(30), nrow = 3) m2 = matrix(rnorm(30), nrow = 3) ?corsP<-vector() ? for(i in 1:3) corsP[i] =? cor(m1[i,], m2[i,]) ?corsP #[1]? 0.58411274 -0.02382329? 0.03760757 diag(cor(t(m1),t(m2))) #[1]? 0.58411274 -0.02382329? 0.03760757 #or mNew<- rbind(m1,m2) ?indx<-rep(seq(nrow(mNew)/2),2) ?sapply(split(seq_len(nrow(mNew)),indx),function(x)
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
2008 Nov 10
1
comparing rows - a possible solution
Hello, sorry for posting this independently of the original thread, but it is not that easy to answer to mails, when receiving the r-help as digest... ... The question was: > I compare each row of a matrix with each row of another matrix. > > testmat1 <- matrix(c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), nrow=4) > testmat2 <- matrix(c(1,2,3,5,5,6,7,8,9,10,11,12,13,14,15,16),
2010 Sep 16
1
The permutation of one vector into another
Dear R-help-list I have two character vectors a <- c("A", "B", "C") b <- c("A", "C", "B") Then sapply(a, function(i) grep(i, b)) computes the permutation of the entries in 'b' needed to bring 'b' into the same order as 'a'. I have searched around, but haven't been able to find any existing function
2005 Sep 16
2
fusion of rows (as in merge()) but from only 1 matrix
Dear all, Once again I need your help ; I fond a way to do what I want but I am sure there is a better way.. maybe you can help me. I have a matrix, for example mat.tot : > mat.tot ID Desc M1 M2 1 1 gene1 0.5 0.2 2 2 gene2 -0.4 -0.1 3 3 gene3 1.0 1.2 4 4 gene1 0.6 0.3 5 5 gene2 -0.3 0.0 and I want to merge line 1 with line 4, and line 2 with line 5 because this is the same gene. I can
2009 Jul 20
2
I need to obtain all the rows in m1 in which m2 the elements of m2 are present
Hi could you yelp me please with this Suppose that we have the following matrix m1<-matrix(c("a","7","a","i","o","u","i","1","2","3","4","5","6","7"), ncol=2) m1 [,1] [,2] [1,] "a" "1" [2,] "7" "2" [3,]
2012 Nov 06
1
Filling matrix elements with a function
Hi all, I have a matrix simulating migration in a spatial model. I want to be able to define movement (the values of m1, m2 and m3) as only != 0 between adjacent patches and contingent on certain conditions as defined in the function. Here is the code: WET<-function(t) {everglades$precipitation[t]} #simply reads precipitation data from a csv, value is numeric AB<-function(WET,t)
2006 Jan 28
1
yet another lmer question
I've been trying to keep track with lmer, and now I have a couple of questions with the latest version of Matrix (0.995-4). I fit 2 very similar models, and the results are severely rounded in one case and rounded not at all in the other. > y <- 1:10 > group <- rep (c(1,2), c(5,5)) > M1 <- lmer (y ~ 1 + (1 | group)) > coef(M1) $group (Intercept) 1 3.1 2
2009 Jul 20
2
Rows for a list of values
Hi could yelp me with this Suppose that we have the following matrix m1<-matrix(c("a","e","a","i","o","u","i","1","2","3","4","5","6","7"), ncol=2) m2<-c("a","i") m1 [,1] [,2] [1,] "a" "1" [2,]
2007 Jun 27
1
Another loop avoidance question.
Hi I want to sum over one of the dimensions of a n x k1 x k2 array in which each column is the product of the corresponding columns from two matrices with dimensions n x k1 and n x k2. I can see two approaches: a loop on k1 and a loop on k2. But I cannot figure a solution that avoids the loop? Is it possible? (I don't refer to apply or lapply etc either as they are just hidden loops so,
2000 Jun 22
0
LSP optimisations
Here are two optimisations for LSP : in vorbis_lsp_to_lpc, Ae and Ao are filled with zero when i increase so you can reduce the j loop, and I replaced qsort in cacm (maybe there are better algorithms, but it's already much faster than qsort on my mac) void vorbis_lsp_to_lpc(double *lsp,double *lpc,int m){ int i,j,m2=m/2; double *O=alloca(sizeof(double)*m2); double
2008 Mar 17
0
'distance' between a vector and a permutation of the vector
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I've been trying to identify a good way to do the following: Say I have a vector of unique, integers x <- c(1,3,2,4,5) I then have a permuted version of the above vector, say y <- c(1,3,5,2,4) Is there an easy way to get the "distance" between the two vectors. The sense I'm thinking of is such, that if we have y
2017 Aug 14
0
Identyfing rows with specific conditions revisited
Allaisone 1 allaisone1 at hotmail.com Mon May 22 02:10:10 CEST 2017 Hi All? I am curious as to whether there is a vectorized solution using base R functions, instead of looping and if statements, to the problem below. I have seen several posts that address a similar question which generally ask to count, identify, etc. a set of values in a row in a data frame or matrix in a much bigger data frame
2006 Mar 13
3
hfsc and dropped packets
Hi, I''m trying to get a handle on hfsc. Here is my configuration: root@jmnrouter:/jmn# tc class show dev vlan1 class hfsc 1: root class hfsc 1:1 parent 1: ls m1 0bit d 0us m2 225000bit ul m1 0bit d 0us m2 225000bit class hfsc 1:10 parent 1:1 rt m1 191000bit d 25.0ms m2 135000bit ls m1 0bit d 0us m2 135000bit ul m1 0bit d 0us m2 225000bit class hfsc 1:20 parent 1:1 rt m1 22008bit d