proc mexp(x,p);
/*Raises the matrix x to the power of p without any fuzz...
Martin W Johansson (date: Oct 31th, 2003)
                   National Institute of Economic Research
                   PO. BOX 3116
                   SE-103 62 Stockholm
                   martin_w.johansson@konj.se

Syntax:xp=mexp(x,p); 
Note: Only works if p is an integer and larger or equal to zero!!
----------------------------------------------------------------
*/
local xp;
xp=eye(cols(x));
if p>0;
for i(1,p,1);
xp=xp*x;
endfor;
endif;
retp(xp);
endp;