Explain the geometrical meaning of Singular Value Decomposition (SVD)
up vote
1
down vote
favorite
Suppose you have a 2x2 real-valued matrix, $mathbf{M}$. If you perform a singular value decomposition (SVD), then Wikipedia and the internet tell me that this can be understood geometrically as a decomposition of $mathbf{M}$ into a rotation, scaling and second rotation of the form:
$$mathbf{M} = mathbf{U S V}^mathrm{T}$$
where the $mathrm{T}$ denotes transpose. Here, $mathbf{V}^mathrm{T}$ is the first rotation, $mathbf{S}$ is the scaling matrix and $mathbf{U}$ is the last rotation.
Wikipedia has this nice little graphic:

So, what I am trying to do is essentially reproduce this graphic in MATLAB. I have a unit circle represented as:
$$mathbf{C} = begin{bmatrix}
1&0 \ 0
& 1
end{bmatrix}$$
This can be plotted in MATLAB like this:

I then have some arbitrary shearing matrix which is given by:
$$mathbf{M} = begin{bmatrix}
0.5&4 \ 1
& 1.5
end{bmatrix}$$
which represents an ellipse which can also be plotted in MATLAB:

So far so good because I can reproduce the top two images in the Wikipedia article.
If I do the SVD for $mathbf{M}$ I can get:
$$mathbf{U} = begin{bmatrix}
-0.9239&-0.3827 \ -0.3827
& 0.9239
end{bmatrix}$$
$$mathbf{S} = begin{bmatrix}
4.3523&0 \ 0
& 0.7467
end{bmatrix}$$
$$mathbf{V} = begin{bmatrix}
-0.1941&-0.9810 \ -0.981
& -0.1941
end{bmatrix}$$
Now, can someone explain what I need to do to produce the bottom two images from the Wikipedia article?
I thought that I would just be able to plot the columns of $mathbf{V}^mathrm{T}mathbf{C}$ to get the rotated unit vectors for the bottom left image like so:

Next, I would plot the ellipse of $mathbf{SC}$ to get the bottom right stretched image and I can apply $mathbf{SV}^mathrm{T}$ to the unit vectors to get:

This is clearly wrong though because the major axis of the dashed ellipse is much longer than the major axis of the solid ellipse representing $mathbf{M}$. If I rotate the dashed ellipse, it will not match the solid ellipse.
What am I doing wrong?
linear-algebra matrices linear-transformations svd
add a comment |
up vote
1
down vote
favorite
Suppose you have a 2x2 real-valued matrix, $mathbf{M}$. If you perform a singular value decomposition (SVD), then Wikipedia and the internet tell me that this can be understood geometrically as a decomposition of $mathbf{M}$ into a rotation, scaling and second rotation of the form:
$$mathbf{M} = mathbf{U S V}^mathrm{T}$$
where the $mathrm{T}$ denotes transpose. Here, $mathbf{V}^mathrm{T}$ is the first rotation, $mathbf{S}$ is the scaling matrix and $mathbf{U}$ is the last rotation.
Wikipedia has this nice little graphic:

So, what I am trying to do is essentially reproduce this graphic in MATLAB. I have a unit circle represented as:
$$mathbf{C} = begin{bmatrix}
1&0 \ 0
& 1
end{bmatrix}$$
This can be plotted in MATLAB like this:

I then have some arbitrary shearing matrix which is given by:
$$mathbf{M} = begin{bmatrix}
0.5&4 \ 1
& 1.5
end{bmatrix}$$
which represents an ellipse which can also be plotted in MATLAB:

So far so good because I can reproduce the top two images in the Wikipedia article.
If I do the SVD for $mathbf{M}$ I can get:
$$mathbf{U} = begin{bmatrix}
-0.9239&-0.3827 \ -0.3827
& 0.9239
end{bmatrix}$$
$$mathbf{S} = begin{bmatrix}
4.3523&0 \ 0
& 0.7467
end{bmatrix}$$
$$mathbf{V} = begin{bmatrix}
-0.1941&-0.9810 \ -0.981
& -0.1941
end{bmatrix}$$
Now, can someone explain what I need to do to produce the bottom two images from the Wikipedia article?
I thought that I would just be able to plot the columns of $mathbf{V}^mathrm{T}mathbf{C}$ to get the rotated unit vectors for the bottom left image like so:

Next, I would plot the ellipse of $mathbf{SC}$ to get the bottom right stretched image and I can apply $mathbf{SV}^mathrm{T}$ to the unit vectors to get:

This is clearly wrong though because the major axis of the dashed ellipse is much longer than the major axis of the solid ellipse representing $mathbf{M}$. If I rotate the dashed ellipse, it will not match the solid ellipse.
What am I doing wrong?
linear-algebra matrices linear-transformations svd
What is the method you are using to take a matrix and plot it as an ellipse?
– Joppy
Nov 15 at 20:42
I am using a code segment from here: mathworks.com/matlabcentral/fileexchange/4705-error_ellipse Specifically look at the function "getpoints". Calculate the eigenvalues and vectors of the matrix and sweep through a set of angles from 0 to 2*pi. Is that where I am going wrong?
– Darcy
Nov 15 at 20:45
1
I have no idea what that function does, but I think the Wikipedia graphic should be starting with (for example) $C$ being a unit circle, and then if $A$ is a matrix, $AC$ is applying $A$ to every point on that circle. You could plot this parametrically by taking the points $A(cos theta, sin theta)$ as $theta$ varies.
– Joppy
Nov 15 at 20:50
Thanks. The two methods do give different answers and your answer is correct...seems weird. I thought there was only one way to transform a 2x2 matrix into an ellipse. Maybe that code is incorrrect....
– Darcy
Nov 15 at 21:00
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Suppose you have a 2x2 real-valued matrix, $mathbf{M}$. If you perform a singular value decomposition (SVD), then Wikipedia and the internet tell me that this can be understood geometrically as a decomposition of $mathbf{M}$ into a rotation, scaling and second rotation of the form:
$$mathbf{M} = mathbf{U S V}^mathrm{T}$$
where the $mathrm{T}$ denotes transpose. Here, $mathbf{V}^mathrm{T}$ is the first rotation, $mathbf{S}$ is the scaling matrix and $mathbf{U}$ is the last rotation.
Wikipedia has this nice little graphic:

So, what I am trying to do is essentially reproduce this graphic in MATLAB. I have a unit circle represented as:
$$mathbf{C} = begin{bmatrix}
1&0 \ 0
& 1
end{bmatrix}$$
This can be plotted in MATLAB like this:

I then have some arbitrary shearing matrix which is given by:
$$mathbf{M} = begin{bmatrix}
0.5&4 \ 1
& 1.5
end{bmatrix}$$
which represents an ellipse which can also be plotted in MATLAB:

So far so good because I can reproduce the top two images in the Wikipedia article.
If I do the SVD for $mathbf{M}$ I can get:
$$mathbf{U} = begin{bmatrix}
-0.9239&-0.3827 \ -0.3827
& 0.9239
end{bmatrix}$$
$$mathbf{S} = begin{bmatrix}
4.3523&0 \ 0
& 0.7467
end{bmatrix}$$
$$mathbf{V} = begin{bmatrix}
-0.1941&-0.9810 \ -0.981
& -0.1941
end{bmatrix}$$
Now, can someone explain what I need to do to produce the bottom two images from the Wikipedia article?
I thought that I would just be able to plot the columns of $mathbf{V}^mathrm{T}mathbf{C}$ to get the rotated unit vectors for the bottom left image like so:

Next, I would plot the ellipse of $mathbf{SC}$ to get the bottom right stretched image and I can apply $mathbf{SV}^mathrm{T}$ to the unit vectors to get:

This is clearly wrong though because the major axis of the dashed ellipse is much longer than the major axis of the solid ellipse representing $mathbf{M}$. If I rotate the dashed ellipse, it will not match the solid ellipse.
What am I doing wrong?
linear-algebra matrices linear-transformations svd
Suppose you have a 2x2 real-valued matrix, $mathbf{M}$. If you perform a singular value decomposition (SVD), then Wikipedia and the internet tell me that this can be understood geometrically as a decomposition of $mathbf{M}$ into a rotation, scaling and second rotation of the form:
$$mathbf{M} = mathbf{U S V}^mathrm{T}$$
where the $mathrm{T}$ denotes transpose. Here, $mathbf{V}^mathrm{T}$ is the first rotation, $mathbf{S}$ is the scaling matrix and $mathbf{U}$ is the last rotation.
Wikipedia has this nice little graphic:

So, what I am trying to do is essentially reproduce this graphic in MATLAB. I have a unit circle represented as:
$$mathbf{C} = begin{bmatrix}
1&0 \ 0
& 1
end{bmatrix}$$
This can be plotted in MATLAB like this:

I then have some arbitrary shearing matrix which is given by:
$$mathbf{M} = begin{bmatrix}
0.5&4 \ 1
& 1.5
end{bmatrix}$$
which represents an ellipse which can also be plotted in MATLAB:

So far so good because I can reproduce the top two images in the Wikipedia article.
If I do the SVD for $mathbf{M}$ I can get:
$$mathbf{U} = begin{bmatrix}
-0.9239&-0.3827 \ -0.3827
& 0.9239
end{bmatrix}$$
$$mathbf{S} = begin{bmatrix}
4.3523&0 \ 0
& 0.7467
end{bmatrix}$$
$$mathbf{V} = begin{bmatrix}
-0.1941&-0.9810 \ -0.981
& -0.1941
end{bmatrix}$$
Now, can someone explain what I need to do to produce the bottom two images from the Wikipedia article?
I thought that I would just be able to plot the columns of $mathbf{V}^mathrm{T}mathbf{C}$ to get the rotated unit vectors for the bottom left image like so:

Next, I would plot the ellipse of $mathbf{SC}$ to get the bottom right stretched image and I can apply $mathbf{SV}^mathrm{T}$ to the unit vectors to get:

This is clearly wrong though because the major axis of the dashed ellipse is much longer than the major axis of the solid ellipse representing $mathbf{M}$. If I rotate the dashed ellipse, it will not match the solid ellipse.
What am I doing wrong?
linear-algebra matrices linear-transformations svd
linear-algebra matrices linear-transformations svd
asked Nov 15 at 20:35
Darcy
144111
144111
What is the method you are using to take a matrix and plot it as an ellipse?
– Joppy
Nov 15 at 20:42
I am using a code segment from here: mathworks.com/matlabcentral/fileexchange/4705-error_ellipse Specifically look at the function "getpoints". Calculate the eigenvalues and vectors of the matrix and sweep through a set of angles from 0 to 2*pi. Is that where I am going wrong?
– Darcy
Nov 15 at 20:45
1
I have no idea what that function does, but I think the Wikipedia graphic should be starting with (for example) $C$ being a unit circle, and then if $A$ is a matrix, $AC$ is applying $A$ to every point on that circle. You could plot this parametrically by taking the points $A(cos theta, sin theta)$ as $theta$ varies.
– Joppy
Nov 15 at 20:50
Thanks. The two methods do give different answers and your answer is correct...seems weird. I thought there was only one way to transform a 2x2 matrix into an ellipse. Maybe that code is incorrrect....
– Darcy
Nov 15 at 21:00
add a comment |
What is the method you are using to take a matrix and plot it as an ellipse?
– Joppy
Nov 15 at 20:42
I am using a code segment from here: mathworks.com/matlabcentral/fileexchange/4705-error_ellipse Specifically look at the function "getpoints". Calculate the eigenvalues and vectors of the matrix and sweep through a set of angles from 0 to 2*pi. Is that where I am going wrong?
– Darcy
Nov 15 at 20:45
1
I have no idea what that function does, but I think the Wikipedia graphic should be starting with (for example) $C$ being a unit circle, and then if $A$ is a matrix, $AC$ is applying $A$ to every point on that circle. You could plot this parametrically by taking the points $A(cos theta, sin theta)$ as $theta$ varies.
– Joppy
Nov 15 at 20:50
Thanks. The two methods do give different answers and your answer is correct...seems weird. I thought there was only one way to transform a 2x2 matrix into an ellipse. Maybe that code is incorrrect....
– Darcy
Nov 15 at 21:00
What is the method you are using to take a matrix and plot it as an ellipse?
– Joppy
Nov 15 at 20:42
What is the method you are using to take a matrix and plot it as an ellipse?
– Joppy
Nov 15 at 20:42
I am using a code segment from here: mathworks.com/matlabcentral/fileexchange/4705-error_ellipse Specifically look at the function "getpoints". Calculate the eigenvalues and vectors of the matrix and sweep through a set of angles from 0 to 2*pi. Is that where I am going wrong?
– Darcy
Nov 15 at 20:45
I am using a code segment from here: mathworks.com/matlabcentral/fileexchange/4705-error_ellipse Specifically look at the function "getpoints". Calculate the eigenvalues and vectors of the matrix and sweep through a set of angles from 0 to 2*pi. Is that where I am going wrong?
– Darcy
Nov 15 at 20:45
1
1
I have no idea what that function does, but I think the Wikipedia graphic should be starting with (for example) $C$ being a unit circle, and then if $A$ is a matrix, $AC$ is applying $A$ to every point on that circle. You could plot this parametrically by taking the points $A(cos theta, sin theta)$ as $theta$ varies.
– Joppy
Nov 15 at 20:50
I have no idea what that function does, but I think the Wikipedia graphic should be starting with (for example) $C$ being a unit circle, and then if $A$ is a matrix, $AC$ is applying $A$ to every point on that circle. You could plot this parametrically by taking the points $A(cos theta, sin theta)$ as $theta$ varies.
– Joppy
Nov 15 at 20:50
Thanks. The two methods do give different answers and your answer is correct...seems weird. I thought there was only one way to transform a 2x2 matrix into an ellipse. Maybe that code is incorrrect....
– Darcy
Nov 15 at 21:00
Thanks. The two methods do give different answers and your answer is correct...seems weird. I thought there was only one way to transform a 2x2 matrix into an ellipse. Maybe that code is incorrrect....
– Darcy
Nov 15 at 21:00
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000287%2fexplain-the-geometrical-meaning-of-singular-value-decomposition-svd%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is the method you are using to take a matrix and plot it as an ellipse?
– Joppy
Nov 15 at 20:42
I am using a code segment from here: mathworks.com/matlabcentral/fileexchange/4705-error_ellipse Specifically look at the function "getpoints". Calculate the eigenvalues and vectors of the matrix and sweep through a set of angles from 0 to 2*pi. Is that where I am going wrong?
– Darcy
Nov 15 at 20:45
1
I have no idea what that function does, but I think the Wikipedia graphic should be starting with (for example) $C$ being a unit circle, and then if $A$ is a matrix, $AC$ is applying $A$ to every point on that circle. You could plot this parametrically by taking the points $A(cos theta, sin theta)$ as $theta$ varies.
– Joppy
Nov 15 at 20:50
Thanks. The two methods do give different answers and your answer is correct...seems weird. I thought there was only one way to transform a 2x2 matrix into an ellipse. Maybe that code is incorrrect....
– Darcy
Nov 15 at 21:00