Skip to content
Prev 42992 / 398506 Next

matrix exponential: M^0

On 20 Jan 2004 16:40:07 +0000, Federico Calboli <f.calboli at ucl.ac.uk>
wrote :
R doesn't have a power operator that knows it's working on a matrix.
M^x raises each entry of M to the power x, it doesn't raise the matrix
to that power.  E.g.
[,1] [,2]
[1,]    2    2
[2,]    2    2
[,1] [,2]
[1,]    4    4
[2,]    4    4
[,1] [,2]
[1,]    8    8
[2,]    8    8

It's a little funny that 0^0 gives 1, but that's a reasonable
convention, often useful in likelihood calculations.

Duncan Murdoch