[R] matrix exponential: M^0
Trenkler, Dietrich
dtrenkler at nts6.oec.uni-osnabrueck.de
Tue Jan 20 17:03:06 CET 2004
> -----Original Message-----
> From: Federico Calboli
> Sent: Tuesday, January 20, 2004 5:40 PM
> To: r-help
> Subject: [R] matrix exponential: M^0
>
> I would like to ask why the zeroeth power of a matrix gives me a matrix
> of ones rather than the identity matrix:
>
> > D<-rbind(c(0,0,0),c(0,0,0),c(0,0,0))
> > D<-as.matrix(D)
> > D
> [,1] [,2] [,3]
> [1,] 0 0 0
> [2,] 0 0 0
> [3,] 0 0 0
>
> > D^0
> [,1] [,2] [,3]
> [1,] 1 1 1
> [2,] 1 1 1
> [3,] 1 1 1
>
> I would have expected the identity matrix here.
>
> I find the same result with every other square matrix I used.
[Dietrich Trenkler] M^0 means appying ^0 to each element of M.
Matrix multiplication can be achieved by A%*%B. In this way A%*%A
is not the same as A^2.
Dietrich
More information about the R-help
mailing list