Displaying 20 results from an estimated 37 matches for "dgematrix".
Did you mean:
dgcmatrix
2018 Mar 01
0
scale.default gives an incorrect error message when is.numeric() fails on a dgeMatrix
>>>>> Michael Chirico <michaelchirico4 at gmail.com>
>>>>> on Tue, 27 Feb 2018 20:18:34 +0800 writes:
Slightly amended 'Subject': (unimportant mistake: a dgeMatrix is *not* sparse)
MM: modified to commented R code, slightly changed from your post:
## I am attempting to use the lars package with a sparse input feature matrix,
## but the following fails:
library(Matrix)
library(lars)
data(diabetes) # from 'lars'
##UAagghh! not like this -- both att...
2018 Feb 27
2
scale.default gives an incorrect error message when is.numeric() fails on a sparse row matrix (dgeMatrix)
...h(diabetes)
x = as(as.matrix(as.data.frame(x)), 'dgCMatrix')
lars(x, y, intercept = FALSE)
Error in scale.default(x, FALSE, normx) :
>
> length of 'scale' must equal the number of columns of 'x'
>
>
More specifically, scale.default fails:
normx = new(
"dgeMatrix",
x = c(1.00000000000004, 1, 1.00000000000009,
1.00000000000001, 1.00000000000001,
0.999999999999992, 1.00000000000004,
0.999999999999975, 1.00000000000006,
1.00000000000006), Dim = c(1L, 10L),
Dimnames =
list(NULL, c("x.age", "x.sex"...
2007 Nov 01
1
Matrix package problem: dsyMatrix %*% vector gives error
...ot;dsyMatrix"
[,1] [,2] [,3]
[1,] 1 2 2
[2,] 2 1 2
[3,] 2 2 1
> M1 %*% 1:3
Fehler in x %*% as.matrix(y) : kann keinen Slot ("Dim") von einem Objekt
vom Typ "integer" bekommen
This does not happen when the multiplication is done with a dgeMatrix, for
example:
> (M2 <- Matrix( 1:9, nrow = 3))
3 x 3 Matrix of class "dgeMatrix"
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
Warning message:
integer matrices not yet implemented in 'Matrix'; using 'double' ones' in:
Matrix...
2020 Sep 11
2
more Matrix weirdness
> > "These operators are also implicit S4 generics, but as
> > primitives, S4 methods will be dispatched only on S4
> > objects ?x?."
> Yes, exactly, very well found, Georgi!
I'm sorry Martin, but I don't understand your point here.
I'm assuming that you want the (S3) matrix, x, to be converted to an
(S4) Matrix.
However, this is not a
2006 Dec 19
1
preserving sparse matrices (Matrix)
...al(5)
> m
5 x 5 diagonal matrix of class "ddiMatrix"
[,1] [,2] [,3] [,4] [,5]
[1,] 1 . . . .
[2,] . 1 . . .
[3,] . . 1 . .
[4,] . . . 1 .
[5,] . . . . 1
> m[1,] <- 0
> m
5 x 5 Matrix of class "dgeMatrix"
[,1] [,2] [,3] [,4] [,5]
[1,] 0 0 0 0 0
[2,] 0 1 0 0 0
[3,] 0 0 1 0 0
[4,] 0 0 0 1 0
[5,] 0 0 0 0 1
> m <- Diagonal(5)
> rbind(m,1:5)
6 x 5 Matrix of class "dgeMatrix"
[,1] [,2] [,3] [,4] [...
2018 Apr 23
4
R 3.5.0 fails its regression test suite on Linux/x86_64
...Matrix(0, 3, 2) # 3 by 2 matrix of zeros -> sparse
| > 3 x 2 sparse Matrix of class "dgCMatrix"
| >
| > [1,] . .
| > [2,] . .
| > [3,] . .
| >
| > Matrix> Matrix(0, 3, 2, sparse=FALSE)# -> 'dense'
| > 3 x 2 Matrix of class "dgeMatrix"
| > [,1] [,2]
| > [1,] 0 0
| > [2,] 0 0
| > [3,] 0 0
| >
| > Matrix> Matrix(0, 2, 2, sparse=FALSE)# diagonal !
| > 2 x 2 diagonal matrix of class "ddiMatrix"
| > [,1] [,2]
| > [1,] 0 .
| > [2,] . 0
|...
2009 Oct 19
1
Defining S3-methods for S4-objects: cannot coerce type 'S4' to vector of type 'integer'
....CI Upper.CI
1 0 261.8724 6.786701 1488.888 1 0 248.5707 275.1741
The problem above arises because esticon.mer() uses the variance-covariance matrix of the fixed effects (vcv below) in a calculation (cm is a matrix):
cm %*% vcv %*% t(cm). The result is:
1 x 1 Matrix of class "dgeMatrix"
[,1]
[1,] 46.05931
- and taking diag() of that matrix causes the error above... However, things work fine if I use as.matrix() as is: diag(as.matrix(cm %*% vcv %*% t(cm))).
- This tentatively suggests that there is no diag() method for 'dgeMatrix' objects (can hardly be the...
2016 Sep 10
3
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
...u for the good question,
and I hope it's fine to answer to the public) :
> with Pi a sparse matrix and x,y, and ones
> compatible n-vectors ? when I do:
>> c(t(x) %*% Pi %*% ones, t(ones) %*% Pi %*% y )
> [[1]] 1 x 1 Matrix of class "dgeMatrix"
> [,1] [1,]
> 0.1338527
> [[2]] 1 x 1 Matrix of class "dgeMatrix"
[,1] [1,]
> 0.7810341
> I get a list whereas if Pi is an ordinary matrix I get a
> vector. Is this intentional?
Well, no. But it has been "unavoidable" in t...
2018 Apr 23
0
R 3.5.0 fails its regression test suite on Linux/x86_64
...eros -> sparse
> | > 3 x 2 sparse Matrix of class "dgCMatrix"
> | >
> | > [1,] . .
> | > [2,] . .
> | > [3,] . .
> | >
> | > Matrix> Matrix(0, 3, 2, sparse=FALSE)# -> 'dense'
> | > 3 x 2 Matrix of class "dgeMatrix"
> | > [,1] [,2]
> | > [1,] 0 0
> | > [2,] 0 0
> | > [3,] 0 0
> | >
> | > Matrix> Matrix(0, 2, 2, sparse=FALSE)# diagonal !
> | > 2 x 2 diagonal matrix of class "ddiMatrix"
> | > [,1] [,2]...
2006 Jul 04
1
lmer print outs without T
Hi,
I have been having a tedious issue with lmer models with lots of
factors and lots of levels. In order to get the basic information at
the beginning of the print out I also have to generate these enormous
tables as well. Is there a method command to leave off all of the
effects and correlations? Or, do I have to go to string commands?
2012 Aug 14
2
Communative Matrix Multiplcation
...(A1)
new("dsCMatrix"
, i = c(0L, 1L, 2L, 3L, 0L, 1L, 4L, 2L, 3L, 5L)
, p = c(0L, 1L, 2L, 3L, 4L, 7L, 10L)
, Dim = c(6L, 6L)
, Dimnames = list(NULL, NULL)
, x = c(5, 5, 5, 5, 5, 5, 10, 5, 5, 10)
, uplo = "U"
, factors = list()
)
> dput(A2)
new("dgeMatrix"
, x = c(1.41313955042629, 1.23647532592053, 1.36413787785255, 0.986247245800629,
2.64961487634682, 2.35038512365318, 1.23647532592053, 1.55872699943971,
0.579347997632991, 1.62544967700677, 2.79520232536024, 2.20479767463976,
1.36413787785255, 0.579347997632991, 2.75106274522123, 0.305451...
2019 Mar 29
1
Discrepancy between is.list() and is(x, "list")
I know I said that I had no further comments on object oriented semantics.
However, I found a contradiction in the R documentation.
Gabriel Becker wrote:
> So, there are implicit classes, but *only when the data object is NOT an
"R object"
In the R Language Definition:
> The R specific function typeof returns the type of an R object.
> Lists have elements, each of which can
2007 Mar 06
1
expm()
Can the expm function be used to calculate the exponential of a matrix where
the matrix is multiplied by a vector in a data frame?
For example
for (i in 1:length(y)){
expmN<-expm(Q*y[i])
Q<-Matrix(c(1, 2, 3, 4), 2, 2)
return(expmN)
}
Sorry I am new to R and I have been finding it difficult to get information
on calculating Matrix exponentials in R.
Many thanks in
2016 Sep 10
1
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
...e it's fine to answer to the public) :
>>
>>> with Pi a sparse matrix and x,y, and ones
>>> compatible n-vectors ? when I do:
>>
>>>> c(t(x) %*% Pi %*% ones, t(ones) %*% Pi %*% y )
>>> [[1]] 1 x 1 Matrix of class "dgeMatrix"
>>> [,1] [1,]
>>> 0.1338527
>>> [[2]] 1 x 1 Matrix of class "dgeMatrix"
>> [,1] [1,]
>>> 0.7810341
>>
>>> I get a list whereas if Pi is an ordinary matrix I get a
>>> vector. Is this...
2006 Dec 28
1
LU bug in Matrix package
There is a bug in Matrix package, please check it, thanks!
Matlab result:
x =
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
>> lu(x)
ans =
21.0000 22.0000 23.0000 24.0000 25.0000
0.0476 0.9524 1.9048 2.8571 3.8095
0.7619
2015 Feb 02
2
Proper way to define cbind, rbind for s4 classes in package
...ange), show a remaining buglet with treating of dimnames :
> M1 <- Matrix(m1 <- matrix(1:12, 3,4))
> cbind(m1, MM = -1)
MM
[1,] 1 4 7 10 -1
[2,] 2 5 8 11 -1
[3,] 3 6 9 12 -1
> cbind(M1, MM = -1) ## ---- notice the "..."
3 x 5 Matrix of class "dgeMatrix"
...
[1,] 1 4 7 10 -1
[2,] 2 5 8 11 -1
[3,] 3 6 9 12 -1
> rbind(R1 = 10:11, m1)
[,1] [,2] [,3] [,4]
R1 10 11 10 11
1 4 7 10
2 5 8 11
3 6 9 12
> rbind(R1 = 10:11, M1) ## --- notice the 'deparse.level'
4 x 4 Mat...
2009 Feb 11
1
Problem with R using pgi compiler on x86_64
...rything 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 cs.o cs_utils.o dense.o dgCMatrix.o dgTMatrix.o dgeMatrix.o
dpoMatrix.o dppMatrix.o dsCMatrix.o dsyMatrix.o dspMatrix.o dtCMatrix.o
dtTMatrix.o dtrMatrix.o dtpMatrix.o factorizations.o ldense.o
lgCMatrix.o sparseQR.o SPQR.a CHOLMOD.a COLAMD.a AMD.a
-L/usr/local/apps/R/R-2.8.1/lib64/R/lib -lRlapack -lRblas -lpgf90
-lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpg...
2016 Sep 10
0
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
...he good question,
> and I hope it's fine to answer to the public) :
>
>> with Pi a sparse matrix and x,y, and ones
>> compatible n-vectors ? when I do:
>
>>> c(t(x) %*% Pi %*% ones, t(ones) %*% Pi %*% y )
>> [[1]] 1 x 1 Matrix of class "dgeMatrix"
>> [,1] [1,]
>> 0.1338527
>> [[2]] 1 x 1 Matrix of class "dgeMatrix"
> [,1] [1,]
>> 0.7810341
>
>> I get a list whereas if Pi is an ordinary matrix I get a
>> vector. Is this intentional?
>
> Well, no. But it has been "una...
2008 Dec 03
1
reduce limit number of arguments in methods:::cbind
Dear all,
As far as I understand, the number of arguments in methods:::cbind is
limited by the "self recursive" construction of the function
which generates nested loops.
A workaround could be to use the internal cbind function on blocks of
non S4 objects. The limitation would then be reduced to the number of
consecutive S4 objects.
##### R code #####
dfr <- data.frame(matrix(0,
2010 Dec 01
1
Install package 'Matrix' problem
...d 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 chm_common.o cs.o cs_utils.o dense.o dgCMatrix.o dgTMatrix.o dgeMatrix.o dpoMatrix.o dppMatrix.o dsCMatrix.o dsyMatrix.o dspMatrix.o dtCMatrix.o dtTMatrix.o dtrMatrix.o dtpMatrix.o factorizations.o ldense.o lgCMatrix.o sparseQR.o abIndex.o CHOLMOD.a COLAMD.a AMD.a -L/apps/sparcv9/R-2.12.0/lib/R/lib -lRlapack -L/apps/sparcv9/R-2.12.0/lib/R/lib -lRblas -lifai -lsunimath...