Page 1 of 1

power of a matrix

Posted: Fri Mar 12, 2010 1:41 am
by contrapunctus
Hello,

how do you calculate the power of a matrix in eviews 7 ?

I have:

matrix_Q (2,2)

This is the square of matrix Q:

matrix(2,2) matrix_Q2= matrix_Q*matrix_Q

How do you calculate

matrix(2,2) matrix_Qn=matrix_Q*...*matrix_Q (n times) ?

Thanks!

Re: power of a matrix

Posted: Fri Mar 12, 2010 9:09 am
by EViews Gareth
I don't believe there is a built in command to do that. You'll have to do it manually in a for loop:

Code: Select all

!power = 3 matrix matrix_out = matrix_in for !i=2 to !power matrix_out = matrix_out * matrix_in next