similar to: Regularization of a matrix that has some tiny negative eigenvalues

Displaying 20 results from an estimated 3000 matches similar to: "Regularization of a matrix that has some tiny negative eigenvalues"

2014 Dec 20
2
Unexplained difference between results of dppsv and dpotri LAPACK routines
Dear R contributors, Considering the following sample C code, that illustrates two possible uses of a Cholesky decomp for inverting a matrix, equally valid at least in theory: SEXP test() { int d = 2; int info = 0; double mat[4] = {2.5, 0.4, 0.4, 1.7}; double id[4] = {1.0, 0.0, 0.0, 1.0}; double lmat[3]; F77_CALL(dpotrf)("L", &d, mat, &d, &info); lmat[0] = mat[0]; lmat[1]
2009 Apr 01
2
Need Advice on Matrix Not Positive Semi-Definite with cholesky decomposition
Dear fellow R Users: I am doing a Cholesky decomposition on a correlation matrix and get error message the matrix is not semi-definite. Does anyone know: 1- a work around to this issue? 2- Is there any approach to try and figure out what vector might be co-linear with another in thr Matrix? 3- any way to perturb the data to work around this? Thanks for any suggestions.
2008 Aug 04
1
simulate data based on partial correlation matrix
Given four known and fixed vectors, x1,x2,x3,x4, I am trying to generate a fifth vector,z, with specified known and fixed partial correlations. How can I do this? In the past I have used the following (thanks to Greg Snow) to generate a fifth vector based on zero order correlations---however I'd like to modify it so that it can generate a fifth vector with specific partial
2017 Nov 20
2
package check fail on Windows-release only?
I mistakenly left a write in "/tmp" in the rockchalk package (version 1.8.109) that I uploaded last Friday. Kurt H wrote and asked me to fix today. While uploading a new one, I became aware of a problem I had not seen. The version I uploaded last Friday, 1.8.109, has OK status on all platforms except r-release-windows-ix86+x86_64. I get OK on oldrel-windows and also on devel-windows.
2010 Feb 07
2
predicting with stl() decomposition
Hi mailinglist members, I’m actually working on a time series prediction and my current approach is to decompose the series first into a trend, a seasonal component and a remainder. Therefore I’m using the stl() function. But I’m wondering how to get the single components in order to predict the particular fitted series’. This code snippet illustrates my problem: series <-
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
2002 Oct 30
1
Error in Fields TPS function {svd ...} again
Thanks for all the helpful responses. I include the data file and the syntax file for reference. Again, if I use the fields function, as is, I get the message: Error in svd(tempM) : error 159 in dsvdc using traceback, I get: > traceback() 4: stop(paste("error ", z$info, " in dsvdc")) 3: svd(tempM) 2: Krig(x, Y, cov.function = rad.cov, m = m, decomp = decomp,
2023 Jun 13
1
log transform a data frame
Thank you so much David, here is correction: d1=suppressWarnings(read.csv("/Users/anamaria/Downloads/B1.csv", stringsAsFactors=FALSE, header=TRUE)) d1$X <- NULL d2=as.matrix(sapply(d1, as.numeric)) pdf("~/graph.pdf") b<-barplot(d2, legend= c("SYCL", "CUDA"), beside= TRUE,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,80), col=c("#9e9ac8",
2007 Jan 04
1
Parameter changes and segfault when calling C code through .Call
I am experiencing some odd behavior with the .Call interface, and I am hoping someone out there can help me with it. Below is a simple example (in that there are R packages that do exactly what I want), but this code illustrates the problem. Thanks in advance for any help you can provide. Suppose I want to compute the log density of a multivariate normal distribution using C code and the gsl
2023 Jun 13
1
log transform a data frame
Hello, I have a data frame like this: d11=suppressWarnings(read.csv("/Users/anamaria/Downloads/B1.csv", stringsAsFactors=FALSE, header=TRUE)) > d11 X Domain.decomp. DD.com..load Neighbor.search Launch.PP.GPU.ops. Comm..coord. 1 SYCL 2. 1 0 3.7 0. 1 1 .6 2 CUDA 2 0 3. 1 0 1 .0
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,
2010 Sep 17
1
How to find STRESS criteria in MDS when there are negative eigenvalues....
Hi, I want to know whether there is any function in R to find STRESS after using cmdscale and estimating the coordinates, I have written these functions to find stress (for p =1,2,3,4,5) stress<-rep(0,5) for(p in 1:5) { datahat<-cmdscale(d,p) deltahat<-as.matrix(dist(datahat)) a<-0 b<-0 for(i in 1:n) { for(j in 1:n) { a<-d[i,j]^2+a b<-(d[i,j]-deltahat[i,j])^2+b } }
2009 Mar 10
5
Cholesky Decomposition in R
Hi everyone: I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I only found how to decomposite A in to LL' by using chol(A),the function Cholesky(A) doesnt work,any one know other command to decomposte A in to LDL' My r code is: library(Matrix) A=matrix(c(1,1,1,1,5,5,1,5,14),nrow=3) > chol(A) [,1] [,2] [,3] [1,] 1 1 1 [2,] 0 2 2
2014 Dec 20
0
Unexplained difference between results of dppsv and dpotri LAPACK routines
This isn't the help list for LAPACK, but as far as I can tell, dppsv expects a symmetric matrix input compacted as triangular, not a Choleski decomposed one. So try assigning lmat before the call to dpotrf. -pd > On 20 Dec 2014, at 22:06 , Pierrick Bruneau <pbruneau at gmail.com> wrote: > > Dear R contributors, > > Considering the following sample C code, that
2011 Jan 29
1
Positive Definite Matrix
Hello I am trying to determine wether a given matrix is symmetric and positive matrix. The matrix has real valued elements. I have been reading about the cholesky method and another method is to find the eigenvalues. I cant understand how to implement either of the two. Can someone point me to the right direction. I have used ?chol to see the help but if the matrix is not positive definite it
2007 Nov 16
1
graphics - line resolution/pixelation going from R to windows metafile
I have a recurring graphics issue that I've not been able to resolve with R. If I make a series of regression estimates and then plot the estimated function for the regression lines over a scatter plot of the data, e.g., using a sequence of plot( ) and lines ( ) similar to those below
2007 Jul 02
2
how to use mle with a defined function
Hi all, I am trying to use mle() to find a self-defined function. Here is my function: test <- function(a=0.1, b=0.1, c=0.001, e=0.2){ # omega is the known covariance matrix, Y is the response vector, X is the explanatory matrix odet = unlist(determinant(omega))[1] # do cholesky decomposition C = chol(omega) # transform data U = t(C)%*%Y WW=t(C)%*%X beta = lm(U~W)$coef Z=Y-X%*%beta
2007 Dec 05
1
Calculating large determinants
I apologise for not including a reproducible example with this query but I hope that I can make things clear without one. I am fitting some finite mixture models to data. Each mixture component has p parameters (p=29 in my application) and there are q components to the mixture. The number of data points is n ~ 1500. I need to select a good q and I have been considering model selection methods
2015 Nov 23
3
MKL Acceleration encouraging; need adjust package builds?
Dear R-devel: The Cluster administrators at KU got enthusiastic about testing R-3.2.2 with Intel MKL when I asked for some BLAS integration. Below I forward a performance report, which is encouraging, and thought you would like to know the numbers. Appears to my untrained eye there are some extraordinary speedups on Cholesky decomposition, determinants, and matrix inversion. They had
2011 Dec 29
1
Cholesky update/downdate
Dear R-devel members, I am looking for a fast Cholesky update/downdate. The matrix A being symmetric positive definite (n, n) and factorized as A = L %*% t(L), the goal is to factor the new matrix A +- C %*% t(C) where C is (n, r). For instance, C is 1-column when adding/removing an observation in a linear regression. Of special interest is the case where A is sparse. Looking at the