Matrix quadratic form expansion question
$begingroup$
I'm trying to do a question and within it, I need to expand a matrix quadratic form:
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x})$
In my working out, I think that the following is correct:
$$
begin{align}
frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) & = frac{1}{2}(vec{y}^{T} - vec{x}^{T}) Sigma (vec{y} - vec{x}) \
& = frac{1}{2} vec{y}^{T}Sigmavec{y} - frac{1}{2} vec{y}^{T}Sigmavec{x} - frac{1}{2} vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}
end{align}
$$
However, in the answers, it says that the answer is
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} - vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}$
so the middle two cross product terms do not have a half multiplied to them. Can anyone explain this? Or are the answers wrong?
Thanks in advance!
matrices matrix-equations
$endgroup$
add a comment |
$begingroup$
I'm trying to do a question and within it, I need to expand a matrix quadratic form:
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x})$
In my working out, I think that the following is correct:
$$
begin{align}
frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) & = frac{1}{2}(vec{y}^{T} - vec{x}^{T}) Sigma (vec{y} - vec{x}) \
& = frac{1}{2} vec{y}^{T}Sigmavec{y} - frac{1}{2} vec{y}^{T}Sigmavec{x} - frac{1}{2} vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}
end{align}
$$
However, in the answers, it says that the answer is
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} - vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}$
so the middle two cross product terms do not have a half multiplied to them. Can anyone explain this? Or are the answers wrong?
Thanks in advance!
matrices matrix-equations
$endgroup$
$begingroup$
It looks like whoever wrote that answer had in mind combining the cross terms, which one can do when $Sigma$ is symmetric, but wrote something else.
$endgroup$
– amd
Jan 8 at 19:35
add a comment |
$begingroup$
I'm trying to do a question and within it, I need to expand a matrix quadratic form:
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x})$
In my working out, I think that the following is correct:
$$
begin{align}
frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) & = frac{1}{2}(vec{y}^{T} - vec{x}^{T}) Sigma (vec{y} - vec{x}) \
& = frac{1}{2} vec{y}^{T}Sigmavec{y} - frac{1}{2} vec{y}^{T}Sigmavec{x} - frac{1}{2} vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}
end{align}
$$
However, in the answers, it says that the answer is
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} - vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}$
so the middle two cross product terms do not have a half multiplied to them. Can anyone explain this? Or are the answers wrong?
Thanks in advance!
matrices matrix-equations
$endgroup$
I'm trying to do a question and within it, I need to expand a matrix quadratic form:
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x})$
In my working out, I think that the following is correct:
$$
begin{align}
frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) & = frac{1}{2}(vec{y}^{T} - vec{x}^{T}) Sigma (vec{y} - vec{x}) \
& = frac{1}{2} vec{y}^{T}Sigmavec{y} - frac{1}{2} vec{y}^{T}Sigmavec{x} - frac{1}{2} vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}
end{align}
$$
However, in the answers, it says that the answer is
$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} - vec{x}^{T}Sigmavec{y} + frac{1}{2}vec{x}^{T}Sigmavec{x}$
so the middle two cross product terms do not have a half multiplied to them. Can anyone explain this? Or are the answers wrong?
Thanks in advance!
matrices matrix-equations
matrices matrix-equations
asked Jan 8 at 18:02
user-2147482565user-2147482565
133
133
$begingroup$
It looks like whoever wrote that answer had in mind combining the cross terms, which one can do when $Sigma$ is symmetric, but wrote something else.
$endgroup$
– amd
Jan 8 at 19:35
add a comment |
$begingroup$
It looks like whoever wrote that answer had in mind combining the cross terms, which one can do when $Sigma$ is symmetric, but wrote something else.
$endgroup$
– amd
Jan 8 at 19:35
$begingroup$
It looks like whoever wrote that answer had in mind combining the cross terms, which one can do when $Sigma$ is symmetric, but wrote something else.
$endgroup$
– amd
Jan 8 at 19:35
$begingroup$
It looks like whoever wrote that answer had in mind combining the cross terms, which one can do when $Sigma$ is symmetric, but wrote something else.
$endgroup$
– amd
Jan 8 at 19:35
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Your answer is correct. Also if $Sigma$ is a symmetric matrix you can simplify the expression as $$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} + frac{1}{2}vec{x}^{T}Sigmavec{x}$$since $$vec{x}^{T}Sigmavec{y}=vec{y}^{T}Sigmavec{x}$$
$endgroup$
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
add a comment |
$begingroup$
Seems to me like the from your Book (?) is wrong and yours is correct.
A good way to do a sanity check for such results is to look at the one-dimensional case. If you then further set $Sigma = 1$, the expression you are trying to expand is $frac12(y - x)(y-x) = frac12(y^2 - 2 x y + x^2) = frac12 y^2 - frac12 y x - frac12 x y + frac12 x^2$, as you calculated. Note that this is not equal to $frac12y^2 - 2 x y + frac12 x^2$ (for example, set $x = y = 1$), the result you Book (?) implies.
$endgroup$
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
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%2f3066514%2fmatrix-quadratic-form-expansion-question%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Your answer is correct. Also if $Sigma$ is a symmetric matrix you can simplify the expression as $$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} + frac{1}{2}vec{x}^{T}Sigmavec{x}$$since $$vec{x}^{T}Sigmavec{y}=vec{y}^{T}Sigmavec{x}$$
$endgroup$
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
add a comment |
$begingroup$
Your answer is correct. Also if $Sigma$ is a symmetric matrix you can simplify the expression as $$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} + frac{1}{2}vec{x}^{T}Sigmavec{x}$$since $$vec{x}^{T}Sigmavec{y}=vec{y}^{T}Sigmavec{x}$$
$endgroup$
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
add a comment |
$begingroup$
Your answer is correct. Also if $Sigma$ is a symmetric matrix you can simplify the expression as $$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} + frac{1}{2}vec{x}^{T}Sigmavec{x}$$since $$vec{x}^{T}Sigmavec{y}=vec{y}^{T}Sigmavec{x}$$
$endgroup$
Your answer is correct. Also if $Sigma$ is a symmetric matrix you can simplify the expression as $$frac{1}{2}(vec{y} - vec{x})^{T} Sigma (vec{y} - vec{x}) = frac{1}{2} vec{y}^{T}Sigmavec{y} - vec{y}^{T}Sigmavec{x} + frac{1}{2}vec{x}^{T}Sigmavec{x}$$since $$vec{x}^{T}Sigmavec{y}=vec{y}^{T}Sigmavec{x}$$
answered Jan 8 at 18:12
Mostafa AyazMostafa Ayaz
18.2k31040
18.2k31040
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
add a comment |
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Okay thank you! I was just wanting to double check. I was so confused for a while
$endgroup$
– user-2147482565
Jan 8 at 18:20
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
$begingroup$
Good luck!.....
$endgroup$
– Mostafa Ayaz
Jan 8 at 18:26
add a comment |
$begingroup$
Seems to me like the from your Book (?) is wrong and yours is correct.
A good way to do a sanity check for such results is to look at the one-dimensional case. If you then further set $Sigma = 1$, the expression you are trying to expand is $frac12(y - x)(y-x) = frac12(y^2 - 2 x y + x^2) = frac12 y^2 - frac12 y x - frac12 x y + frac12 x^2$, as you calculated. Note that this is not equal to $frac12y^2 - 2 x y + frac12 x^2$ (for example, set $x = y = 1$), the result you Book (?) implies.
$endgroup$
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
add a comment |
$begingroup$
Seems to me like the from your Book (?) is wrong and yours is correct.
A good way to do a sanity check for such results is to look at the one-dimensional case. If you then further set $Sigma = 1$, the expression you are trying to expand is $frac12(y - x)(y-x) = frac12(y^2 - 2 x y + x^2) = frac12 y^2 - frac12 y x - frac12 x y + frac12 x^2$, as you calculated. Note that this is not equal to $frac12y^2 - 2 x y + frac12 x^2$ (for example, set $x = y = 1$), the result you Book (?) implies.
$endgroup$
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
add a comment |
$begingroup$
Seems to me like the from your Book (?) is wrong and yours is correct.
A good way to do a sanity check for such results is to look at the one-dimensional case. If you then further set $Sigma = 1$, the expression you are trying to expand is $frac12(y - x)(y-x) = frac12(y^2 - 2 x y + x^2) = frac12 y^2 - frac12 y x - frac12 x y + frac12 x^2$, as you calculated. Note that this is not equal to $frac12y^2 - 2 x y + frac12 x^2$ (for example, set $x = y = 1$), the result you Book (?) implies.
$endgroup$
Seems to me like the from your Book (?) is wrong and yours is correct.
A good way to do a sanity check for such results is to look at the one-dimensional case. If you then further set $Sigma = 1$, the expression you are trying to expand is $frac12(y - x)(y-x) = frac12(y^2 - 2 x y + x^2) = frac12 y^2 - frac12 y x - frac12 x y + frac12 x^2$, as you calculated. Note that this is not equal to $frac12y^2 - 2 x y + frac12 x^2$ (for example, set $x = y = 1$), the result you Book (?) implies.
answered Jan 8 at 18:08
0x5390x539
1,445518
1,445518
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
add a comment |
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
$begingroup$
Thanks for the reply! This is really helpful
$endgroup$
– user-2147482565
Jan 8 at 18:21
add a comment |
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.
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%2f3066514%2fmatrix-quadratic-form-expansion-question%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
$begingroup$
It looks like whoever wrote that answer had in mind combining the cross terms, which one can do when $Sigma$ is symmetric, but wrote something else.
$endgroup$
– amd
Jan 8 at 19:35