search for: eig

Displaying 20 results from an estimated 57 matches for "eig".

Did you mean: big
2006 Jul 21
3
positive semi-definite matrix
I have a covariance matrix that is not positive semi-definite matrix and I need it to be via some sort of adjustment. Is there any R routine or package to help me do this? Thanks, Roger [[alternative HTML version deleted]]
2008 Jun 03
3
matlab eigs function in R
Hello Does anybody know how one can compute d largest eigenvalues/eigenvectors in R, like in MATLAB eigs function ? eigen function computes all eigenvectors/eigenvalues, and they are slightly different than those generated by matlab eigs. Thanks in advance -- View this message in context: http://www.nabble.com/matlab-eigs-function-in-R-tp17619641p17619...
2010 Feb 18
1
R-commands for MDS
Hello I am using the following command but not able to text the values on the graph can someone please make suggestions for improvement #here is the command loc_mds <- cmdscale(dist.r, k = 7, eig = TRUE) loc_mds$eig sum(abs(loc_mds$eig[1:2]))/sum(abs(loc_mds$eig)) sum((loc_mds$eig[1:2])^2)/sum((loc_mds$eig)^2) x <-loc_mds$points[,1] y <-loc_mds$points[,2] plot(x, y, xlab="Coordinate 1", ylab="Coordinate 2", main="Metric MDS", type="n") text...
2002 Jan 07
3
cluster - clusplot.default (PR#1249)
The following code in clusplot.default (package cluster) is in error: x1 <- cmdscale(x, k = 2, eig = TRUE) var.dec <- sum(x1$eig)/sum(diag(x1$x)) if (var.dec < 0) var.dec <- 0 if (var.dec > 1) var.dec <- 1 x1 <- x1$points x1 has components with names "points" and "eig", not "x", so sum(dia...
2005 Jan 08
0
cmdscale problem
Dear R developers, there appears to be a small problem with function cmdscale: for non-Euclidean distance matrices, using option add=FALSE (the default), cmdscale misses the smallest eigenvalue. This affects GOF statistic g.1 (See Mardia, Kent + Bibby (1979): Multivariate Analysis, eq. (14.4.7). The corresponding formula in Cox + Cox (2001): Multidimensional Scaling, 2nd ed., p 38, would seem to contain a misprint, it should be n instead of n-1.) Example: R> cmdscale(eurod...
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
...to 3 significant digits in 5017 iterations. nlminb(c(-1.2, 1), banana, Dbanana, D2banana) # took 95 iterations to find the answer to double precision. To understand this better, I wrote my own version of "nlm" (see below), and learned that the hessian is often indefinite, with one eigenvalue positive and the other negative. If I understand correctly, a negative eigenvalue of the hessian tends to push the next step towards increasing rather than decreasing the function. I tried a few things that accelerated the convergence slightly, but but my "nlm." still had not...
2004 Apr 19
0
R analog of Matlab "eigs" function
Hi, I was wondering if anyone knew of an implementation of a function similar to "eigs" in Matlab (full description here: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/eigs.html). This function differs from the standard "eigen" in that it computes a *few* eigenvectors for cases in which your matrix is very large and/or you don't need all the eigenvec...
2008 Apr 01
1
superimpose histogram on biplot
...groups = as.factor(c(rep(1,2), rep(2,4), rep(3,4))) s.arrow(dfxy=nipmat$co[,1:2]*8, sub="Day 10", possub="bottomleft", csub=3) s.class(dfxy=nipmat$li[,1:2], fac=groups, cellipse=2, axesell=F, cstar=0 , col=c(2:3), add.plot=T) I can create the histogram using: plot(nipmat$eig/sum(nipmat$eig), type='h') but I don't know how to superimpose it on the above graph. Thanks for any help! Best, Jennie Jennie Lavine PhD Candidate Center for Infectious Disease Dynamics Penn State University 505 ASI Building (814)863-1815 [[alternative HTML version deleted]]
2003 Dec 01
1
matrix bending
Dear All, I was wondering whether any one knows of a matrix bending function in R that can turn non-positive definite matrices into the nearest positive definite matrix. I was hoping there would be something akin to John Henshall's flbend program (http://agbu.une.edu.au/~kmeyer/pdmatrix.html), which allows the standard errors of the estimated matrix elements to be considered in the
2008 Jan 05
2
Cumulative sum of vector
Hi, Maybe I have not been looking in the right spot, but, I have not been able to fine a command to automatically calculate the running cumulative sum of a vector. Is there such a command? Example of current code: > eig$values [1] 678.365651 6.769697 2.853783 > prop<-eig$values/sum(eig$values) > prop [1] 0.986012163 0.009839832 0.004148005 > cum<-c(prop[1],sum(prop[1:2]),sum(prop[1:3])) > cum [1] 0.9860122 0.9958520 1.0000000 This works, but, if the length of the vector changes I have to...
2011 May 23
0
storing data from loops
...list, I have a problem storing results from a bootstrap loop. What I doing is creating an empty matrix before the loop, then run the loop. Before the end of the loop I have a command line which defines which results inside the loop will have to go in the empty matrix. Here is the code I am using: eigen.values<-rep(NA,boots) #storage file for eigen values (1 for simulation) ssd.values<-matrix(NA,nrow=boots,ncol=9, byrow=TRUE) #storage file for ssd (9 for each simulation) for(i in 1:boots){ #beginning of bootstrap B<-A s<-rbeta(1,a,b) #survival is sampled from beta distributi...
2008 Mar 03
1
Extracting data from Eigen function
Hi I need to extract the data returned by Eigen to plot the eigenvectors. However, when I try and eigv = eigen(covariance); it returns an object with the matrices containing eigenvalues and vectors.. how can I extract the eigenvector matrix from this?? When I try mat = eig["vectors"] it returns a matrix with the "$vectors"...
2006 Mar 13
0
wishlist: function mlh.mlm to test multivariate linear hypotheses of the form: LBT'=0 (PR#8680)
...object) df.res <- ssd$df rss.qr <- qr(T %*% ssd$SSD %*% t(T)) X <- as.matrix( model.matrix(object) ) B <- as.matrix( object$coef ) df <- nrow(L) ss <- t(L %*% B) %*% as.matrix(solve(L %*% solve(t(X) %*% X) %*% t(L))) %*% (L %*% B) eigs <- Re(eigen(qr.coef(rss.qr, T %*% ss %*% t(T)), symmetric = FALSE)$values) test <- match.arg(test) stats <- switch(test, "Pillai" = Pillai(eigs, df, df.res),...
2003 Apr 03
2
Matrix eigenvectors in R and MatLab
Dear R-listers Is there anyone who knows why I get different eigenvectors when I run MatLab and R? I run both programs in Windows Me. Can I make R to produce the same vectors as MatLab? #R Matrix PA9900<-c(11/24 ,10/53 ,0/1 ,0/1 ,29/43 ,1/24 ,27/53 ,0/1 ,0/1 ,13/43 ,14/24 ,178/53 ,146/244 ,17/23 ,15/43 ,2/24 ,4/53 ,0/1 ,2/23 ,2/43 ,4/24 ,58/53 ,26/244 ,0/1 ,...
2006 Dec 05
1
Cummulative Variance in Correspondence Analysis (ADE4)
Hi all: How can I calculate the cumulative variance (or variance for each component) in correspondence analysis? If were possible in ADE4 package Thank you -- Antonio Punzón Merino O__---- Instituto Español de Oceanografía c/ /'_ --- Centro Oceanográfico de Santander (*) \(*) -- Promontorio de San Martín S/N ~~~~~~~~~~ 39004-Santander; Spain PO BOX: 240 Tlf: +34 942 29 10 60 Fax: +34
2005 Nov 04
1
Stress in multidimensional scaling
Hello, We are trying to find a function to compute "stress" in our multidimensional scaling analysis of a dissimilarity matrix. We've used "dist()" to create the matrix and "cmdscale()" for the scaling. In order to determine the number of dimensions we would like to plot stress vs. dimensions. However, we cannot find a pre-made command. It seems that other
2012 Mar 15
0
PCA R
...lt is rather disappointing as the points are very very small and there are no titles etc geochemdata<-read.csv(file.choose(),header=TRUE) names(geochemdata) library(vegan) bstick<-function(n, tot.var=1) rev(cumsum(tot.var/n:1)/n) geopca<-rda(geochemdata, scale=TRUE) geopca geopca$CA$eig/geopca$tot.chi summary(geopca, scaling=2) apply(scores(geopca, choices=1.6, display= "species"), + 2,function(x) x/sd(x)) plot(geopca$CA$eig, type= "o", col= "red", xlab= "PCA Axis", ylab= "Variance", main= "Scree plot for the PCA of the G...
2010 Jan 11
3
Eigenvectors and values in R and SAS
Hi, I was wondering if function eigen() does something different from the function call eigen() in SAS. I'm in the process of translating a SAS code into a R code and the values of the eigenvectors and eigenvalues of a square matrix came out to be different from the values in SAS. I would also appreciate it if someone can expla...
2009 Dec 01
1
eigenvalues of complex matrices
Dear all, I want to compute the eigenvalues of a complex matrix for some statistics. Comparing it to its matlab/octave sibling, I don't get the same eigenvalues in R computing it from the exact same matrix. In R, I used eigen() and arpack() that give different eigenvalues. In matlab/octave I used eig() and eigs() that give out t...
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 exists. Thanks! --j -- Jonathan A. Green...