[R] matrix exponential: M^0

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Tue Jan 20 17:08:19 CET 2004


Federico Calboli wrote:
> Dear All, 
> 
> I would like to ask why the zeroeth power of a matrix gives me a matrix
> of ones rather than the identity matrix:
> 

  Because ^0 gives you the zero-th power of the _elements_ of the 
matrix, not the matrix itself. A matrix of 0^0 is all 1s.

  Similary, '*' multiplies the elements together, it doesn't do matrix 
multiplication. For that you need %*%.

  There is no %^% operator for matrix exponentials.

Baz




More information about the R-help mailing list