similar to: Efficient testing for +ve definiteness

Displaying 20 results from an estimated 2000 matches similar to: "Efficient testing for +ve definiteness"

2005 May 30
2
trouble with cumsum?
Dear R users, I am using R version 2.0.1 (2004/11/15) on an i386-pc-mingw32 platform. I encounter the following problem while using cumsum: > a <- rep(0.01, 100) > b <- cumsum(a) > sum(a) == 1 [1] TRUE > b[100] == 1 [1] FALSE Am I missing something? Should cumsum have such an outcome? Thanks in advance for any clarifications any of you can offer. Regards, Makram Talih --
2003 Feb 28
3
NULL object, R programming
Dear R users, I get the following (I think puzzling) result when doing the following: > a <- list(3,4,5) > a[[2]] <- NULL > a [[1]] [1] 3 [[2]] [1] 5 I would have expected the result to be: [[1]] [1] 3 [[2]] NULL [[3]] [1] 4 as in the outcome of: > list(3, NULL, 4) Is this a desired effect? If so, could it be built in a 'help(NULL)' file? If you think it is
2004 Apr 15
5
Solving Matrices
On April 15th, Elizabeth wrote: <snip> > In execises 39-42, determine if the columns of the matrix span > R4: <snip> >(or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5, > 4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4) > >That is the whole of the question <snip> Have you tried det(x) and/or eigen(x) ? A zero determinant (within
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 =
2009 Mar 20
2
Finding determinants of x-loaded matrix?
R friends, I need to find the determinant of this matrix x 1 0 0 1 x 1 0 0 1 x 1 0 0 1 x det yields x^4-3x^2+1 I can then use polyroot to find the roots of the coefficients. The question is about the use of "x", which is what I'm solving for. thanks in advance, and this is a back-burner question. Apologies if I have posted this incorrectly/to the wrong place, I'm a newbie
2011 Mar 16
2
Singularity problem
Dear R, If I have remembered correctly, a square matrix is singular if and only if its determinant is zero. I am a bit confused by the following code error. Can someone give me a hint? > a <- matrix(c(1e20,1e2,1e3,1e3),2) > det(a) [1] 1e+23 > solve(a) Error in solve.default(a) : system is computationally singular: reciprocal condition number = 1e-17 Thanks in advance! Feng --
2009 Oct 15
4
Generating a stochastic matrix with a specified second dominant eigenvalue
Hi, Given a positive integer N, and a real number \lambda such that 0 < \lambda < 1, I would like to generate an N by N stochastic matrix (a matrix with all the rows summing to 1), such that it has the second largest eigenvalue equal to \lambda (Note: the dominant eigenvalue of a stochastic matrix is 1). I don't care what the other eigenvalues are. The second eigenvalue is
2007 Jul 13
2
nearest correlation to polychoric
Dear all, Has someone implemented in R (or any other language) Knol DL, ten Berge JMF. Least-squares approximation of an improper correlation matrix by a proper one. Psychometrika, 1989, 54, 53-61. or any other similar algorithm? Best regards Jens Oehlschl?gel Background: I want to factanal() matrices of polychoric correlations which have negative eigenvalue. I coded Highham 2002
2007 Jun 29
4
Dominant eigenvector displayed as third (Marco Visser)
Dear R users & Experts, This is just a curiousity, I was wondering why the dominant eigenvetor and eigenvalue of the following matrix is given as the third. I guess this could complicate automatic selection procedures. 0 0 0 0 0 5 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 Please
2005 May 30
3
how to invert the matrix with quite small eigenvalues
Dear all, I encounter some covariance matrix with quite small eigenvalues (around 1e-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)
2010 Nov 10
2
prcomp function
Hello, I have a short question about the prcomp function. First I cite the associated help page (help(prcomp)): "Value: ... SDEV the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix). ROTATION the matrix of variable loadings
2012 Apr 19
3
Solve an ordinary or generalized eigenvalue problem in R?
Folks: I'm trying to port some code from python over to R, and I'm running into a wall finding R code that can solve a generalized eigenvalue problem following this function model: http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eig.html Any ideas? I don't want to call python from within R for various reasons, I'd prefer a "native" R solution if one
2002 Nov 05
2
eigenvectors order
Hi, How the eigenvectors output by the eigen() function are ordered. The first column corresponds to the largest eigenvalue? or is the last column as in Octave? I'm performing a spatial-temporal analysis of some climatic variables so my matrices are MxN (locations*time)and I'm looking for the leading EOF's. As I have understand the eigenvectors columns represent those EOF's
2010 Jun 25
2
Forcing scalar multiplication.
I am trying to check the results from an Eigen decomposition and I need to force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l' is the eigen value and x is the eigen vector corresponding to the eigenvalue. 'R' returns the eigenvalues as a vector (e <- eigen(A); e$values). So in order to 'check' the result I would multiply the eigenvalues
2005 Jun 06
3
(Off topic.) Observed Fisher information.
I have been building an R function to calculate the ***observed*** (as opposed to expected) Fisher information matrix for parameter estimates in a rather complicated setting. I thought I had it working, but I am getting a result which is not positive definite. (One negative eigenvalue. Out of 10.) Is it the case that the observed Fisher information must be positive definite --- thereby
2011 Feb 04
2
always about positive definite matrix
1. Martin Maechler's comments should be taken as replacements for anything I wrote where appropriate. Any apparent conflict is a result of his superior knowledge. 2. 'eigen' returns the eigenvalue decomposition assuming the matrix is symmetric, ignoring anything in m[upper.tri(m)]. 3. The basic idea behind both posdefify and nearPD is to compute the
2012 Mar 09
1
Eigenvalue calculation of sparse matrices
Dear all, I am currently working on the calculation of eigenvalues (and -vectors) of large matrices. Since these are mostly sparse matrices and I remember some specific functionalities in MATLAB for sparse matrices, I started a research how to optimize the calculation of eigenvalues of a sparse matrix. The function eigen itself works with the LAPACK library which has no special handling for
2017 Jul 18
3
Redundancy canonical analysis plot problem in 3D using VEGAN, RGL, SCATTERPLOT3D and SFSMISC
Hello Sir I am getting problem in plotting in CCA . Could you please help me? I wrote the below command but I don't know why it is taking only first 5 env data rather than all 9. > strain.data <- read.xlsx("Dee rhiz.xlsx", sheetName="strain", header = T, row.names = 1) > env.data <- read.xlsx("Dee rhiz.xlsx", sheetName="env", header = T,
2011 Nov 14
2
How to compute eigenvectors and eigenvalues?
Hello. Consider the following matrix: mp <- matrix(c(0,1/4,1/4,3/4,0,1/4,1/4,3/4,1/2),3,3,byrow=T) > mp [,1] [,2] [,3] [1,] 0.00 0.25 0.25 [2,] 0.75 0.00 0.25 [3,] 0.25 0.75 0.50 The eigenvectors of the previous matrix are 1, 0.25 and 0.25 and it is not a diagonalizable matrix. When you try to find the eigenvalues and eigenvectors with R, R responses: > eigen(mp) $values [1]
2002 Nov 05
2
Which columns give rise to linear dependency?
Short version If I have a data frame X and I suspect that there is a dependency between the columns how do I confirm that, and how do I tell which subset of columns is involved? ================================== Long version A colleague had been trying to use the SPSS RELIABILITY procedure. It told her that the determinant of the matrix was small. She asked me what that meant and I told her