Cholesky and $P^T LDL^T P$ decompositions not corresponding












0












$begingroup$


I am using the Eigen library to factorize a matrix $A$ both using the Cholesky and the $LDL^T$ factorization.



Basically, I correctly compute a matrix $C$ and check that $$A=CC^T,$$ then I correctly compute $P$, $L$, and $D$, and check that $$A=P^TLDL^TP,$$ where $P$ is a permutation matrix generated by Eigen. However if $D=sqrt D(sqrt D)^T$, $$Cneq P^TLsqrt D.$$



This is really counterintuitive for me. Is there any reason about this?
Thanks a lot.










share|cite|improve this question









$endgroup$












  • $begingroup$
    In general, $C C^T = B B^T$ does not imply that $C=B$. For example, if $Q$ is a rotation, $C C^T = C Q Q^T C^T = (CQ) (CQ)^T$, and, in general, we do not have $C = CQ$.
    $endgroup$
    – copper.hat
    Nov 13 '18 at 14:54












  • $begingroup$
    @copper.hat, thanks a lot for your answer, I did not think to see this problem in this way. Then, I ask myself what is the meaning of the uniqueness of the Cholesky decomposition for positive definite matrices. Is it unique apart of a rotation of $L$?
    $endgroup$
    – marco
    Nov 13 '18 at 15:56
















0












$begingroup$


I am using the Eigen library to factorize a matrix $A$ both using the Cholesky and the $LDL^T$ factorization.



Basically, I correctly compute a matrix $C$ and check that $$A=CC^T,$$ then I correctly compute $P$, $L$, and $D$, and check that $$A=P^TLDL^TP,$$ where $P$ is a permutation matrix generated by Eigen. However if $D=sqrt D(sqrt D)^T$, $$Cneq P^TLsqrt D.$$



This is really counterintuitive for me. Is there any reason about this?
Thanks a lot.










share|cite|improve this question









$endgroup$












  • $begingroup$
    In general, $C C^T = B B^T$ does not imply that $C=B$. For example, if $Q$ is a rotation, $C C^T = C Q Q^T C^T = (CQ) (CQ)^T$, and, in general, we do not have $C = CQ$.
    $endgroup$
    – copper.hat
    Nov 13 '18 at 14:54












  • $begingroup$
    @copper.hat, thanks a lot for your answer, I did not think to see this problem in this way. Then, I ask myself what is the meaning of the uniqueness of the Cholesky decomposition for positive definite matrices. Is it unique apart of a rotation of $L$?
    $endgroup$
    – marco
    Nov 13 '18 at 15:56














0












0








0





$begingroup$


I am using the Eigen library to factorize a matrix $A$ both using the Cholesky and the $LDL^T$ factorization.



Basically, I correctly compute a matrix $C$ and check that $$A=CC^T,$$ then I correctly compute $P$, $L$, and $D$, and check that $$A=P^TLDL^TP,$$ where $P$ is a permutation matrix generated by Eigen. However if $D=sqrt D(sqrt D)^T$, $$Cneq P^TLsqrt D.$$



This is really counterintuitive for me. Is there any reason about this?
Thanks a lot.










share|cite|improve this question









$endgroup$




I am using the Eigen library to factorize a matrix $A$ both using the Cholesky and the $LDL^T$ factorization.



Basically, I correctly compute a matrix $C$ and check that $$A=CC^T,$$ then I correctly compute $P$, $L$, and $D$, and check that $$A=P^TLDL^TP,$$ where $P$ is a permutation matrix generated by Eigen. However if $D=sqrt D(sqrt D)^T$, $$Cneq P^TLsqrt D.$$



This is really counterintuitive for me. Is there any reason about this?
Thanks a lot.







linear-algebra matrices matrix-decomposition






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 13 '18 at 14:50









marcomarco

112




112












  • $begingroup$
    In general, $C C^T = B B^T$ does not imply that $C=B$. For example, if $Q$ is a rotation, $C C^T = C Q Q^T C^T = (CQ) (CQ)^T$, and, in general, we do not have $C = CQ$.
    $endgroup$
    – copper.hat
    Nov 13 '18 at 14:54












  • $begingroup$
    @copper.hat, thanks a lot for your answer, I did not think to see this problem in this way. Then, I ask myself what is the meaning of the uniqueness of the Cholesky decomposition for positive definite matrices. Is it unique apart of a rotation of $L$?
    $endgroup$
    – marco
    Nov 13 '18 at 15:56


















  • $begingroup$
    In general, $C C^T = B B^T$ does not imply that $C=B$. For example, if $Q$ is a rotation, $C C^T = C Q Q^T C^T = (CQ) (CQ)^T$, and, in general, we do not have $C = CQ$.
    $endgroup$
    – copper.hat
    Nov 13 '18 at 14:54












  • $begingroup$
    @copper.hat, thanks a lot for your answer, I did not think to see this problem in this way. Then, I ask myself what is the meaning of the uniqueness of the Cholesky decomposition for positive definite matrices. Is it unique apart of a rotation of $L$?
    $endgroup$
    – marco
    Nov 13 '18 at 15:56
















$begingroup$
In general, $C C^T = B B^T$ does not imply that $C=B$. For example, if $Q$ is a rotation, $C C^T = C Q Q^T C^T = (CQ) (CQ)^T$, and, in general, we do not have $C = CQ$.
$endgroup$
– copper.hat
Nov 13 '18 at 14:54






$begingroup$
In general, $C C^T = B B^T$ does not imply that $C=B$. For example, if $Q$ is a rotation, $C C^T = C Q Q^T C^T = (CQ) (CQ)^T$, and, in general, we do not have $C = CQ$.
$endgroup$
– copper.hat
Nov 13 '18 at 14:54














$begingroup$
@copper.hat, thanks a lot for your answer, I did not think to see this problem in this way. Then, I ask myself what is the meaning of the uniqueness of the Cholesky decomposition for positive definite matrices. Is it unique apart of a rotation of $L$?
$endgroup$
– marco
Nov 13 '18 at 15:56




$begingroup$
@copper.hat, thanks a lot for your answer, I did not think to see this problem in this way. Then, I ask myself what is the meaning of the uniqueness of the Cholesky decomposition for positive definite matrices. Is it unique apart of a rotation of $L$?
$endgroup$
– marco
Nov 13 '18 at 15:56










1 Answer
1






active

oldest

votes


















0












$begingroup$

As copper.hat said in his comment, we generally cannot infer that $C=B$ if we only know that $CC^T=BB^T$.



However, to answer the question in OP's comment: this fact does not violate the uniqueness of the Cholesky factorization because to call $A=CC^T$ a "Cholesky factorization", we need that $C$ is lower-triangular; presumably the $P^TLsqrt{D}$ that arose from the Eigen calculation was not lower-triangular.



(In particular, the uniqueness of Cholesky decomposition is a consequence of the uniqueness of $LU$ factorization.)






share|cite|improve this answer









$endgroup$













    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%2f2996823%2fcholesky-and-pt-ldlt-p-decompositions-not-corresponding%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    As copper.hat said in his comment, we generally cannot infer that $C=B$ if we only know that $CC^T=BB^T$.



    However, to answer the question in OP's comment: this fact does not violate the uniqueness of the Cholesky factorization because to call $A=CC^T$ a "Cholesky factorization", we need that $C$ is lower-triangular; presumably the $P^TLsqrt{D}$ that arose from the Eigen calculation was not lower-triangular.



    (In particular, the uniqueness of Cholesky decomposition is a consequence of the uniqueness of $LU$ factorization.)






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      As copper.hat said in his comment, we generally cannot infer that $C=B$ if we only know that $CC^T=BB^T$.



      However, to answer the question in OP's comment: this fact does not violate the uniqueness of the Cholesky factorization because to call $A=CC^T$ a "Cholesky factorization", we need that $C$ is lower-triangular; presumably the $P^TLsqrt{D}$ that arose from the Eigen calculation was not lower-triangular.



      (In particular, the uniqueness of Cholesky decomposition is a consequence of the uniqueness of $LU$ factorization.)






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        As copper.hat said in his comment, we generally cannot infer that $C=B$ if we only know that $CC^T=BB^T$.



        However, to answer the question in OP's comment: this fact does not violate the uniqueness of the Cholesky factorization because to call $A=CC^T$ a "Cholesky factorization", we need that $C$ is lower-triangular; presumably the $P^TLsqrt{D}$ that arose from the Eigen calculation was not lower-triangular.



        (In particular, the uniqueness of Cholesky decomposition is a consequence of the uniqueness of $LU$ factorization.)






        share|cite|improve this answer









        $endgroup$



        As copper.hat said in his comment, we generally cannot infer that $C=B$ if we only know that $CC^T=BB^T$.



        However, to answer the question in OP's comment: this fact does not violate the uniqueness of the Cholesky factorization because to call $A=CC^T$ a "Cholesky factorization", we need that $C$ is lower-triangular; presumably the $P^TLsqrt{D}$ that arose from the Eigen calculation was not lower-triangular.



        (In particular, the uniqueness of Cholesky decomposition is a consequence of the uniqueness of $LU$ factorization.)







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Dec 19 '18 at 5:16









        aleph_twoaleph_two

        24912




        24912






























            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%2f2996823%2fcholesky-and-pt-ldlt-p-decompositions-not-corresponding%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

            Wiesbaden

            Marschland

            Dieringhausen