Displaying 2 results from an estimated 2 matches for "ddimatrix".

Did you mean:
bdsmatrix

2007 Mar 15

1

expm() within the Matrix package

Hi
Could anybody give me a bit of advice on some code I'm having trouble with?
I've been trying to calculate the loglikelihood of a function iterated over
a data of time values and I seem to be experiencing difficulty when I use
the function expm(). Here's an example of what I am trying to do
y<-c(5,10) #vector of 2 survival times
p<-Matrix(c(1,0),1,2) #1x2 matrix

2006 Oct 19

0

incorrect result for Matrix() %*% Diagonal()

I'm exploring pedigree() in lme4 and found some strange results trying
to multiply a dtCMatrix by a diag() matrix using %*%. Studying the
Matrix documentation, I stumbled upon the following error in the
example on the ddiMatrix-class {Matrix} help page. I wonder if my
problem could be related to this.
> matrix(cbind(1, 2:4),3,2) %*% diag(c(10,1)) # OK
[,1] [,2]
[1,] 10 2
[2,] 10 3
[3,] 10 4
> Matrix(cbind(1, 2:4)) %*% Diagonal(x=c(10,1)) # KO
3 x 2 Matrix of class "dgeMatrix"
[,1...