Displaying 20 results from an estimated 200 matches similar to: "Matrix / SparseM conflict (PR#8618)"
1999 Jun 30
1
qr and Moore-Penrose
> Date: Wed, 30 Jun 1999 11:12:24 +0200 (MET DST)
> From: Torsten Hothorn <hothorn at amadeus.statistik.uni-dortmund.de>
>
> yesterday I had a little shock using qr (or lm). having a matrix
>
> X <- cbind(1,diag(3))
> y <- 1:3
>
> the qr.coef returns one NA (because X is singular). So I computed the
> Moore-Penrose inverse of X (just from the
2012 Jun 20
1
prcomp: where do sdev values come from?
In the manual page for prcomp(), it says that sdev is "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)." ?However, this is not what I'm finding. ?The values appear
to be the standard deviations of a reprojection of
2004 Nov 09
1
gdist and gower distance
Dear All,
I would like to ask clarifications on the gower distnce matrix calculated by the function gdistin the library mvpart.
Here is a dummy example:
> library(mvpart)
Loading required package: survival
Loading required package: splines
mvpart package loaded: extends rpart to include
multivariate and distance-based partitioning
> x=matrix(1:6, byrow=T, ncol=2)
> x
[,1]
2012 Oct 24
4
Z score
Hi,
I need to find the z-score of the data present in a speardsheet. The values
needs to be calculated for each gene across the samples (refer the
example). And, it should be a simple thing, but I am unable to do it right
now !
The example re the structure of the spreadsheet is -
# Example:
MyFile <- read.csv( text=
"Names,'Sample_1','Sample_2','Sample_3'
2009 Apr 23
1
the definition of eigenvector in R
Dear All
i have a little puzzle about eigenvector in the R.
As we know that the eigenvector can be displayed on several form.
For example
A=matrix(c(1,2,4,3),2,2)
if we want to get the eigenvalue and eigenvector, the code followed
eigen(A)
$values
[1] 5 -1
$vectors
[,1] [,2]
[1,] -0.7071068 -0.8944272
[2,] -0.7071068 0.4472136
however, we also can calculate the vector matrix
2008 Nov 03
1
qr() and Gram-Schmidt
Hi,
Why the qr() produces a negative Q compared with Gram-Schmidt? (note
example below, except Q[2,3])
Here is an example, I calculate the Q by Gram-Schmidt process and
compare the output with qr.Q()
a <- c(1,0,1)
b <- c(1,0,0)
c <- c(2,1,0)
x <- matrix(c(a,b,c),3,3)
##########################
# Gram-Schmidt
##########################
A <- matrix(a,3,1)
q1 <-
2003 Oct 24
5
how to remove NaN columns ?
How can I remove columns with NaN entries ?
Here is my simple example:
> data <- read.csv("test.csv")
> xdata <- data[3:length(data)]
> xs <- lapply(xdata, function(x){(x - mean(x))/sqrt(var(x))})
> x <- data.frame(xs)
> x
C D E F
1 -0.7071068 NaN -0.7071068 -0.7071068
2 0.7071068 NaN 0.7071068 0.7071068
2009 Feb 11
1
Problem with R using pgi compiler on x86_64
Hi,
we have installed R-2.8.1 using the current pgi compiler (8.0.2) for
AMD64 on a SLES9 system.
When I try to install "Matrix" everything is fine until the last step.
make[1]: Leaving directory `/tmp/R.INSTALL.TW3399/Matrix/src/AMD'
pgCC -L/usr/lib64 -L/usr/X11R6/lib64 -pgf90libs -o Matrix.so
CHMfactor.o Csparse.o TMatrix_as.o Tsparse.o init.o Mutils.o
chm_common.o
2010 Dec 01
1
Install package 'Matrix' problem
64-bit R-2.12.0 was installed on Sun SPARC Solaris 10. Compiler used is solstudio12.2. Attached is the configure script.
I then tried to install a recommended package called Matrix. The compilation failed with the following messages,
.......
CC -library=stlport4 -G -L/opt/csw/lib/sparcv9 -L/opt/solstudio12.2/prod/lib/v9 -o Matrix.so CHMfactor.o Csparse.o TMatrix_as.o Tsparse.o init.o Mutils.o
2012 Jun 30
3
How to adjust the start of a series to zero? (i.e. subtract the first value from the sequence)
Hello,
I'd have a time series, where I am plotting the means and sd of a distance
for a variety of positions along a bird's bill. I'd like to set each line
(represented by "point") to start at zero, so that I can look at the
absolute change along the series. At the moment I only know how to do that
in Excel, by subtracting the value of time 1, point 1 from all other times
2013 Mar 14
2
Same eigenvalues but different eigenvectors using 'prcomp' and 'principal' commands
Dear all,
I've used the 'prcomp' command to
calculate the eigenvalues and eigenvectors of a matrix(gg).
Using the command 'principal' from the
'psych' packageĀ I've performed the same exercise. I got the same
eigenvalues but different eigenvectors. Is there any reason for that
difference?
Below are the steps I've followed:
1. PRCOMP
#defining the matrix
2006 Jun 16
2
bug in prcomp (PR#8994)
The following seems to be an bug in prcomp():
> test <- ts( matrix( c(NA, 2:5, NA, 7:10), 5, 2))
> test
Time Series:
Start = 1
End = 5
Frequency = 1
Series 1 Series 2
1 NA NA
2 2 7
3 3 8
4 4 9
5 5 10
> prcomp(test, scale.=TRUE, na.action=na.omit)
Erro en svd(x, nu = 0) : infinite or missing values in 'x'
2011 Feb 21
2
Segfaults of eigen
Hi,
with small matrices eigen works as expected:
> eigen(cbind(c(1,4),c(4,7)), only.values = TRUE)
$values
[1] 9 -1
$vectors
NULL
> eigen(cbind(c(1,4),c(4,7)))
$values
[1] 9 -1
$vectors
[,1] [,2]
[1,] 0.4472136 -0.8944272
[2,] 0.8944272 0.4472136
> eigen(cbind(c(1,-1),c(1,-1)))
$values
[1] -3.25177e-17+1.570092e-16i -3.25177e-17-1.570092e-16i
$vectors
2008 Oct 19
2
definition of "dffits"
R-users
E-mail: r-help@r-project.org
Hi! R-users.
I am just wondering what the definition of "dffits" in R language is.
Let me show you an simple example.
function() {
library(MASS)
xx <- c(1,2,3,4,5)
yy <- c(1,3,4,2,4)
data1 <- data.frame(x=xx, y=yy)
lm.out <- lm(y~., data=data1, x=T)
lev1 <- lm.influence(lm.out)$hat
sig1 <-
2009 Feb 21
1
R-devel/Linux x64/Sun Studio 12: Problem with Matrix
Dear Developers,
motivated by the new Sun Studio checks I compiled R-devel and several of
our packages with Sun Studio 12 on Fedora x64.
Everything worked fine and R-devel runs, with the exception of package
Matrix where compilation crashes with the following message. The error
occurs during building of the recommended packages and also if Matrix is
compiled separately:
[...]
CC -G -lCstd
2005 Feb 23
1
model.matrix for a factor effect with no intercept
I was surprised by this (in R 2.0.1):
> a <- ordered(-1:1)
> a
[1] -1 0 1
Levels: -1 < 0 < 1
> model.matrix(~ a)
(Intercept) a.L a.Q
1 1 -7.071068e-01 0.4082483
2 1 -9.073800e-17 -0.8164966
3 1 7.071068e-01 0.4082483
attr(,"assign")
[1] 0 1 1
attr(,"contrasts")
attr(,"contrasts")$a
[1]
2007 Jan 08
2
Contrasts for ordered factors
Dear all,
I do not seem to grasp how contrasts are set for ordered factors. Perhaps someone can elighten me?
When I work with ordered factors, I would often like to be able to reduce the used polynomial to a simpler one (where possible). Thus, I would like to explicetly code the polynomial but ideally, the intial model (thus, the full polynomial) would be identical to one with an ordered factor.
2009 Dec 17
1
poly() with unnormalized values
How can I get the result of, e.g., poly(1:3. degree=2) to give me the
unnormalized integer coefficients
usually used to explain orthogonal polynomial contrasts, e.g,
-1 1
0 -2
1 1
As I understand things, the columns of x^{1:degree} are first centered
and then
are normalized by 1/sqrt(col sum of squares), but I can't
see how to relate this to what is returned by poly().
>
2010 Jul 16
3
how to skip a specific value when using apply() function to a matrix?
Hello R experts,
I'd like to studentize a matrix (tmp1) by column using apply() function and skip some specific values such as zeros in the example below to tmp2 but not tmp3. I used the script below and only can get a matrix tmp3. Could you please help me to studentize the matrix (tmp1) without changing the zeros and generate a new matrix tmp2?
Thanks,
Joshua
tmp1
[,1] [,2] [,3] [,4]
2009 Nov 27
2
Symmetric Matrix classes
Hi,
I'd like to store large covariance matrices using Matrix classes.
dsyMatrix seems like the right one, but I want to specify just the
upper/lower triangle and diagonal and not have to instantiate a huge
n^2 vector just for the sake of having half of it ignored:
Dumb example:
M <- new("dsyMatrix", uplo="U", x=rnorm(1e4), Dim=as.integer(c(100, 100)))
diag(M) <- 1