search for: symmetr

Displaying 20 results from an estimated 1315 matches for "symmetr".

Did you mean: symmetry
2011 Oct 23
0
FW: Re: symmetric matrix multiplication
...step [2] in the example below). Apologies! -----FW: <XFMail.111023084327.ted.harding at wlandres.net>----- Date: Sun, 23 Oct 2011 08:43:27 +0100 (BST) Sender: r-help-bounces at r-project.org From: (Ted Harding) <ted.harding at wlandres.net> To: r-help at r-project.org Subject: Re: [R] symmetric matrix multiplication On 23-Oct-11 07:00:07, Daniel Nordlund wrote: >> -----Original Message----- >> From: r-help-bounces at r-project.org >> [mailto:r-help-bounces at r-project.org] >> On Behalf Of statfan >> Sent: Saturday, October 22, 2011 10:45 PM >> To: r...
2013 Jun 18
1
eigen(symmetric=TRUE) for complex matrices
R-3.0.1 rev 62743, binary downloaded from CRAN just now; macosx 10.8.3 Hello, eigen(symmetric=TRUE) behaves strangely when given complex matrices. The following two lines define 'A', a 100x100 (real) symmetric matrix which theoretical considerations [Bochner's theorem] show to be positive definite: jj <- matrix(0,100,100) A <- exp(-0.1*(row(jj)-col(jj))^2) A's b...
2005 May 01
2
eigen() may fail for some symmetric matrices, affects mvrnorm()
...ters. The NaNs came from mvrnorm (Ripley & Venables' MASS package multivariate normal sampling function) and with some more investigation it turned out that they were generated by function eigen, the eigenvalue computing function. The problem did not seem to happen when the option "symmetric" was set to FALSE; at first I thought that only matrices that were not completely symmetric (such as ones with small errors of the magnitude 1e-17 or so) were affected but then we encountered matrices that were perfectly symmetric but eigen still generated NaNs when symmetric=TRUE. I wr...
2007 Jul 28
8
generating symmetric matrices
Greetings, I have a seemingly simple task which I have not been able to solve today. I want to construct a symmetric matrix of arbtriray size w/o using loops. The following I thought would do it: p <- 6 Rmat <- diag(p) dat.cor <- rnorm(p*(p-1)/2) Rmat[outer(1:p, 1:p, "<")] <- Rmat[outer(1:p, 1:p, ">")] <- dat.cor However, the problem is that the matrix is filled by col...
2000 May 10
4
Q: Problems with eigen() vs. svd()
At 01:37 PM 5/10/00 +0200, ralle wrote: >Hi, >I have a problem understanding what is going on with eigen() for >nonsymmetric matrices. >Example: >h<-rnorm(6) >> dim(h)<-c(2,3) >> c<-rnorm(6) "c" is not a great choice of identifier! >> dim(c)<-c(3,2) >> Pi<-h %*% c >> eigen(Pi)$values >[1] 1.56216542 0.07147773 These could have been complex, of course, b...
2009 Apr 24
4
Long string in crypting
I use a solution to crypt a string that I found using OpenSSL. But the crypted string becomes very long, too long for a varchar 255 to hold it. What can I do to make it shorter? Or should I just use text as column in the mysql db? public_key_file = ''lib/public.pem'' public_key = OpenSSL::PKey::RSA.new(File.read(public_key_file)) @encrypted_string =
2011 Jan 20
2
splitting a square symmetric matrix
So many matrices are square symmetrical (i.e. variance-covariance matrices), is there any way to get R to split the matrix on its diagonal and just return one diagonal? So if I have mat<-matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE) is there anyway to get the lower right diagonal instead of the entire symm...
2011 Oct 23
1
symmetric matrix multiplication
I have a symmetric matrix B (17x17), and a (17x17) square matrix A. If do the following matrix multiplication I SHOULD get a symmetric matrix, however i don't. The computation required is: C = t(A)%*%B%*%A here are some checks for symmetry > (max(abs(B - t(B)))) [1] 0 > C = t(A)%*%B%*%A > (max(abs(...
2005 May 30
3
how to invert the matrix with quite small eigenvalues
...18), which are smaller than the machine precision. The dimension of my matrix is 17. Here I just fake some small matrix for illustration. a<-diag(c(rep(3,4),1e-18)) # a matrix with small eigenvalues b<-matrix(1:25,ncol=5) # define b to get an orthogonal matrix b<-b+t(b) bb<-eigen(b,symmetric=T) aah<-bb$vectors%*%diag(1/sqrt(diag(a))) aa<-aah%*%t(aah) # aa should have the same eigenvalues as a and should be #invertable,however, solve(aa) # can not be solved solve(aa,tol=1e-19) # can be inverted, however, it is not symmetric and furthermore, solve(aa,tol=1e-19)%*%aa # deviat...
2004 Oct 05
0
SIP and symmetric NAT
Hello, I have a problem with a Grandstream being behind a symmetric nat. The box which does the nat is a german "Fritz Box". This one does nat for the internal network. In the internal network is a Granstream BudgeTone 100. The nat router has a dial-up connection, so ip changes on every dial-in. |------------| |------------| |----...
2013 Feb 05
2
adjacency list to non-symmetric matrix
Dear R community, is there an easy way to convert an adjacency list (or a data-frame) to a non-symmetric matrix? The adjacency list has the following form: person group 1 Sam a 2 Sam b 3 Sam c 4 Greg a 5 Tom b 6 Tom c 7 Tom d 8 Mary b 9 Mary d I need the data in a matrix with persons as rows and groups as columns: a b c d Sam 1 1 1 0 Greg 1 0 0 0 Tom 0 1 1 1 Mary 0 1 0 1 I know that there are s...
2005 May 02
14
eigenvalues of a circulant matrix
...pears that the real values are close, but not exactly so, and there is no imaginary part whatsoever. x<-scan("kinv.dat") #length(x) = 216 y<-x[c(109:216,1:108)] X<-toeplitz(y) eigen(X)$vectors Note that the eigenvectors are correct, and they are indeed real, because X is symmetric. Is this a bug in R? Any insight if not, please! Many thanks and best wishes! This is unrelated, but can the R-help archive maintainers please not put e-mail addresses in the archive? This would really help people like me who would like to post using their professional e-mail addresses. Just...
2010 Aug 03
4
Need help on upper.tri()
HI, I am really messing up to make a symmetrical matrix using upper.tri() & lower.tri() function. Here is my code:   > set.seed(1) > mat = matrix(rnorm(25), 5, 5) > mat            [,1]       [,2]       [,3]        [,4]        [,5] [1,] -0.6264538 -0.8204684  1.5117812 -0.04493361  0.91897737 [2,]  0.1836433  0.4874291  0.3898432...
2006 Mar 03
1
NA in eigen()
Hi, I am using eigen to get an eigen decomposition of a square, symmetric matrix. For some reason, I am getting a column in my eigen vectors (the 52nd column out of 601) that is a column of all NAs. I am using the option, symmetric=T for eigen. I just discovered that I do not get this behavior when I use the option EISPACK=T. With EISPACK=T, the 52nd eigenvector is...
2006 Sep 26
2
about the determinant of a symmetric compound matrix
Dear R users, even if this question is not related to an issue about R, probably some of you will be able to help me. I have a square matrix of dimension k by k with alpha on the diagonal and beta everywhee else. This symmetric matrix is called symmetric compound matrix and has the form a( I + cJ), where I is the k by k identity matrix J is the k by k matrix of all ones a = alpha - beta c = beta/a I need to evaluate the determinant of this matrix. Is there any algebric formula for that? thank you for your help Stefano...
2010 Apr 30
2
Flattening and unflattening symmetric matrices
Here's an easy question: I'd like to convert a symmetric matrix to a vector composed of the upper.tri() part of it plus the diagonal, and convert it back again. What's the best way to achieve this? I'm wondering if there are some built in functions to do this easily. I can encode fine: v <- c(diag(A),A[upper.tri(A)]) but I don't see...
2011 Apr 06
1
Creating a symmetric contingency table from two vectors with different length of levels in R
Hello, How can I create a symmetric contingency table from two categorical vectors having different length of levels? For example one vector has 98 levels TotalData1$Taxa.1 [1] "Aconoidasida" "Actinobacteria (class)" "Actinopterygii" "Alphaproteobacteria&quot...
2010 Nov 08
1
Exponent of sqr symmetric matrix
Dear R experts, I really have difficulty when I try to deal with this question. suppose X is a square symmetric matrix. The exponent of X is defined by the matrix limit as following: exp(X) = lim (I + X/n)^n, note: the limit is from n to infinite. How can I write R function for the above? Thank you very much -- View this message in context: http://r.789695.n4.nabble.com/Exponent-of-sqr-symmetric-matri...
2006 Jan 04
5
habtm recusive
I have a people table: CREATE TABLE people ( id int(10) unsigned NOT NULL auto_increment, first_name varchar(75) default NULL, middle_name varchar(75) default NULL, last_name varchar(75) default NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1272 ; and a people_people table: CREATE TABLE people_people ( person_id int(11) unsigned NOT NULL,
2009 Jan 07
2
Memory Efficiency of Symmetric Matrix
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm generating a symmetric correlation matrix using a data matrix as input: mat <- cor(data.mat) My question is: Is there a more memory efficient way to store this data? For instance, since: all(mat == t(mat)) every value is duplicated, and I should be able to almost half the memory usage for large matrices. Any thoug...