I got an eigenvector of a matrix and I need to normalize this vector but I don't know how. Anyone can help?
If x + i*y is a complex vector, then the norm is
|| x + i*y || = (x+i*y)*(x-i*y) = sqrt(sum(x##2 + y##2) = sqrt(norm(x) + norm(y))
Thus, either of the following will work:
proc iml
/* For a complex vector x + i*y, the complex norm is
(x+i*y)*(x-i*y) = sqrt(x##2 + y##2)
*/
x = {1, 1, 3};
y = {2, -2, 0};
norm1 = sqrt( sum(x##2 + y##2) );
norm2 = sqrt(norm(x)**2 + norm(y)**2);
print norm1 norm2;
You can use the NORM() function in PROC IML (and then divide the vector itself by its NORM)
Thanks so much
If you used SAS/IML to get the eigenvector, then it is already normalized. All eigenvectors have unit L2 norm.
If you got the vector from somewhere else, Paige gives the correct answer for real eigenvectors.
If the eigenvector is complex, write back, and we can help with that.
First thank you so much Rick
Actually I got my eigenvectors from sas/iml. However i like to learn more, so if you do not mind, could you please share how can i get normalized vectors if they are complex.
If x + i*y is a complex vector, then the norm is
|| x + i*y || = (x+i*y)*(x-i*y) = sqrt(sum(x##2 + y##2) = sqrt(norm(x) + norm(y))
Thus, either of the following will work:
proc iml
/* For a complex vector x + i*y, the complex norm is
(x+i*y)*(x-i*y) = sqrt(x##2 + y##2)
*/
x = {1, 1, 3};
y = {2, -2, 0};
norm1 = sqrt( sum(x##2 + y##2) );
norm2 = sqrt(norm(x)**2 + norm(y)**2);
print norm1 norm2;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.