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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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?










share|cite|improve this question






















  • 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















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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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?










share|cite|improve this question






















  • 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













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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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?










share|cite|improve this question













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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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:



enter image description here



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






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










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


















  • 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















active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?