Displaying 20 results from an estimated 200 matches similar to: "eigenvalues and correlation matrices"
2007 Jul 31
2
remove NA rows and columns
Hello,
I guess, it's a rather simple thing but I cannot find a short way to reduce a
matrix, removing all rows and columns having just NA elements.
testmatrix <- matrix(nrow=6, ncol=4)
testmatrix[2:5,2:3] <- seq(2)
> testmatrix
[,1] [,2] [,3] [,4]
[1,] NA NA NA NA
[2,] NA 1 1 NA
[3,] NA 2 2 NA
[4,] NA 1 1 NA
[5,] NA 2 2 NA
2003 Jul 03
2
SVD and spectral decompositions of a hermitian matrix
Hi:
I create a hermitian matrix and then perform its singular value
decomposition. But when I put it back, I don't get the original
hermitian matrix. I am having the same problem with spectral value
decomposition as well.
I am using R 1.7.0 on Windows. Here is my code:
X <- matrix(rnorm(16)+1i*rnorm(16),4)
X <- X + t(X)
X[upper.tri(X)] <- Conj(X[upper.tri(X)])
Y <-
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 being
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody
When one is working with complex matrices, "transpose" very nearly
always means
*Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]).
One often writes A^* for the Hermitian transpose.
I have only once seen a "real-life" case
where transposition does not occur simultaneously with complex conjugation.
And I'm not 100% sure that that wasn't a
2010 Feb 08
1
Help with assigning values to a row or column
Hello,
I am attempting to write a function that assigns a value to a row or column
within the matrix that it runs on. I am, however, having trouble accessing
the row or column within this dynamic variable. I have looked through the
archives (nothing there) and read the rules for posting to this list. Please
help me out!
Here is a sample of the problem:
testMatrix = matrix(data=2, nrow=10,
2008 Apr 03
1
by "infelicity"
Dear list,
Please find below an example of odd
behaviour of the by function.
It occurs both under GNU/Linux R 2.6.2
and Windows R 2.7.0alpha. Respective
sessionInfo()'s are given below.
I hope I do not overlook anything.
testFactor <- factor(sample(LETTERS[1:6], size = 42, replace = TRUE))
testMatrix <- matrix(rnorm(42 * 6), nrow = 42)
testDf <- as.data.frame(testMatrix)
by(data
2008 Nov 04
1
contour plot, failing to interpolate through all data
I'm having trouble making contour lines for this attached, sparse
dataset (low data:NA ratio!). Is it the high number of NA's, or funny
layout of the densities, or something else that's causing this? This is
a subsample of the dataset, and I get the same problem when using the
full data. The only reason I get any contours is because I'm forcing
specific levels. If no levels are
2012 Apr 23
0
Solve an ordinary or generalized eigenvalue problem in R
This thread reveals that R has some holes in the solution of some of the linear algebra
problems that may arise. It looks like Jim Ramsay used a quick and dirty approach to the
generalized eigenproblem by using B^(-1) %*% A, which is usually not too successful due to
issues with condition of B and making a symmetric/Hermitian problem unsymmetric.
In short, the problem is stated as follows:
2007 Nov 29
1
?eigen documentation suggestion
from ?eigen
symmetric: if 'TRUE', the matrix is assumed to be symmetric (or
Hermitian if complex) and only its lower triangle is used. If
'symmetric' is not specified, the matrix is inspected for
symmetry.
I think that could mislead a naive reader as it suggests that, with symmetric=TRUE,
the result of eigen() (vectors and values) depends only on
2004 Dec 10
1
How to circumvent negative eigenvalues in the capscale function
Dear All
I am trying to do a partial canonical analysis of principal coordinates
using Bray-Curtis distances. The capscale addin to R appears to be the only
way of doing it, however, when I try and calculate a Bray-Curtis distance
matrix either using Capscale or Vegedist (capscale I understand uses
Vegedist anyway to calculate its distance matrix), R uses up all available
memory on the computer,
2020 Sep 13
1
[cfe-dev] Phabricator -> GitHub PRs?
Fangrui Song via cfe-dev <cfe-dev at lists.llvm.org> writes:
>
> One property of "Squash and merge" is that it will add intermediate
> commits as bullet points (`* `). In many cases the merger does not spend
> more time cleaning up the description so a commit may look like:
>
> ```
> RFC: treat small negative λ as 0 for sqrt(::Hermitian) (#35057)
>
>
2007 Feb 06
3
How-To construct a cov list to use a covariance matrix in factanal?
Hi,
I have a set of covariance matrices but not the original data. I want to carry out some exploratory factor analysis. So, I am trying to construct a covariance matrix list as the input for factanal. I can construct a list which includes the cov, the centers, and the n.obs. But it doesn't work. I get an error that says "Error in sqrt(diag(cv)) : Non-numeric argument to mathematical
2010 Dec 04
1
Quadratic programming with semi-definite matrix
Hello.
I'm trying to solve a quadratic programming problem of the form min
||Hx - y||^2 s.t. x >= 0 and x <= t using solve.QP in the quadprog
package but I'm having problems with Dmat not being positive definite,
which is kinda okay since I expect it to be numerically semi-definite
in most cases. As far as I'm aware the problem arises because the
Goldfarb and Idnani method first
2020 Sep 11
2
[cfe-dev] Phabricator -> GitHub PRs?
On Fri, Sep 11, 2020 at 6:53 PM David Blaikie <dblaikie at gmail.com> wrote:
> Is there any observable difference between "Squash and Merge" or "Rebase
> and Merge" when "enforce linear history" is enabled, then?
>
"Squash and Merge" will only generate one commit.
>
> On Fri, Sep 11, 2020 at 3:45 PM Stephen Neuendorffer via llvm-dev
2010 Jun 12
1
Fast way to compute largest eigenvector
Hello all,
I was wondering if there is a function in R that only computes the eigenvector
corresponding to the largest/smallest eigenvalue of an arbitrary real matrix.
Thanks
Minh
--
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.
2010 Sep 22
3
eigen and svd
Dear R-helpers,
could anybody explain me briefly what is the difference between
eigenvectors returned by 'eigen' and 'svd' functions and how they are
related?
Thanks in advance
Ondrej Mikula
2004 Sep 01
0
not positive definite D matrix in quadprog
Hello to everybody,
I have a quadratic programming problem that I am trying to solve by various
methods. One of them is to use the quadprog package in R.
When I check positive definiteness of the D matrix, I get that one of the
eigenvalues is negative of order 10^(-8). All the others are positive. When
I set this particular eigenvalue to 0.0 and I recheck the eigenvalues in R,
the last
2002 Mar 05
1
Matrix identification bug (PR#1361)
Full_Name: Hao Yu
Version: 1.4.1
OS: Windws and Linux
Submission from: (NULL) (129.100.45.161)
Hi,
Recently we did some benchmarks regarding matrix inverse operation and found
some strange things. See the following results (the package Matrix is most
updated).
1. load the function Toeplitz and library(Matrix)
"Toeplitz"
function(x)
{
matrix(x[1 + abs(outer(seq(along = x),
2012 Apr 26
0
nearest positive semidefinit toeplitz matrix
hHllo,
I'm looking for an algroithm to transform an existing toeplitz matrix
(autocorrelation matrix) to the nearest positive semidefinite toeplitz
matrix.
I merely found an algorithm to transform an correlation matrix via the
function nearcor() based on the algorithm of Higham.
But as I examined, it destroys the toeplitz structure of my underlying
matrix.
Does any function already exist
2005 May 02
14
eigenvalues of a circulant matrix
Hi,
It is my understanding that the eigenvectors of a circulant matrix are given as
follows:
1,omega,omega^2,....,omega^{p-1}
where the matrix has dimension given by p x p and omega is one of p complex
roots of unity. (See Bellman for an excellent discussion on this).
The matrix created by the attached row and obtained using the following
commands
indicates no imaginary parts for the