Matrix quadratic form expansion question












2












$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!










share|cite|improve this question









$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
















2












$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!










share|cite|improve this question









$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














2












2








2





$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!










share|cite|improve this question









$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






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










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


















  • $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










2 Answers
2






active

oldest

votes


















1












$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}$$






share|cite|improve this answer









$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



















1












$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.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thanks for the reply! This is really helpful
    $endgroup$
    – user-2147482565
    Jan 8 at 18:21












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',
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
});


}
});














draft saved

draft discarded


















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









1












$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}$$






share|cite|improve this answer









$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
















1












$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}$$






share|cite|improve this answer









$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














1












1








1





$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}$$






share|cite|improve this answer









$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}$$







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










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


















  • $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











1












$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.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thanks for the reply! This is really helpful
    $endgroup$
    – user-2147482565
    Jan 8 at 18:21
















1












$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.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thanks for the reply! This is really helpful
    $endgroup$
    – user-2147482565
    Jan 8 at 18:21














1












1








1





$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.






share|cite|improve this answer









$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.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










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


















  • $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


















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.




draft saved


draft discarded














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





















































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

Bressuire

Cabo Verde

Gyllenstierna