Lu-Yi-Hsun
10/11/2017 - 11:32 AM

eigen

proc iml;
x={3 1 0 ,
6 4 6,
4 2 2,
7 0 3,
5 3 4

};

n=nrow(x);
one=j(n,1,1);
xbar=one*x/n;
print xbar ;


run;
data a;

a=9;b=0;c=4;

do x1=-10 to 10  by 0.5;
do x2=-10 to 10 by 0.5;
z=a*x1*x1+2*b*x1*x2+c*x2*x2;
output;end;end;

symbol c=blue v=none i=none;
proc g3d;
plot x2*x1=z/rotate=70 tilt=75 grid;
axis1 order=-12 to 12 by 4;
axis2 order=-8 to 8 by 4;

proc gcontour;

plot x2*x1=z/level=225 haxis=axis1 vaxis=axis2 href=0 vref=0;
run;
proc iml;

a={13 -4 2,
-4 13 -2,
2 -2 0};
call eigen(m,e,a);
print  m e;


ch1=e`*e;
ch2=e*e`;


print ch1 ch2;



ch3=e`*a*e;
print ch3;