{"id":1071,"date":"2024-02-12T21:01:26","date_gmt":"2024-02-12T21:01:26","guid":{"rendered":"https:\/\/sinatootoonian.com\/?p=1071"},"modified":"2025-12-27T16:06:51","modified_gmt":"2025-12-27T16:06:51","slug":"inverting-arrowhead-matrices","status":"publish","type":"post","link":"https:\/\/sinatootoonian.com\/index.php\/2024\/02\/12\/inverting-arrowhead-matrices\/","title":{"rendered":"Inverting arrowhead matrices."},"content":{"rendered":"\n<p>I need to invert a matrix of the form $$ M  = I + S^2 H S^2,$$ where $H$ is a symmetric matrix, and $S^2$ is diagonal. The elements of $S^2$ drop off very quickly, so what remains of $H$ are its first column and first row, scaled by $S_{1}^2 S^2$. The result is that $M$ looks, appropriately enough on the day after the Chiefs won the SuperBowl, like an arrowhead, consisting of a diagonal, the leftmost column, and the topmost row. We&#8217;re going to invert such matrices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Computing the inverse elementwise.<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"272\" src=\"https:\/\/sinatootoonian.com\/wp-content\/uploads\/2024\/02\/arrowhead_matrix1-1024x272.png\" alt=\"\" class=\"wp-image-1072\" srcset=\"https:\/\/sinatootoonian.com\/wp-content\/uploads\/2024\/02\/arrowhead_matrix1-1024x272.png 1024w, https:\/\/sinatootoonian.com\/wp-content\/uploads\/2024\/02\/arrowhead_matrix1-300x80.png 300w, https:\/\/sinatootoonian.com\/wp-content\/uploads\/2024\/02\/arrowhead_matrix1-768x204.png 768w, https:\/\/sinatootoonian.com\/wp-content\/uploads\/2024\/02\/arrowhead_matrix1-1536x408.png 1536w, https:\/\/sinatootoonian.com\/wp-content\/uploads\/2024\/02\/arrowhead_matrix1-2048x544.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To invert the matrix elementwise, we represent it as in the figure above, as consisting of the sum of a diagonal matrix and a &#8216;corner&#8217; matrix made of the same vector $h$ as the leftmost column and the topmost row. That is,<br>$$ M_{ij} = \\delta_{ij} + \\delta_{i1}h_j + h_i\\delta_{1j} &#8211; h_{1} \\delta_{i1}\\delta_{1j},$$ where the last term avoids double counting the term at the top-left corner.<\/p>\n\n\n\n<p>The inverse $G$ satisfies $\\sum_{k} M_{ik} G_{kj} = \\delta_{ij}.$ Then \\begin{align}\\delta_{ij} &amp;= \\sum_k M_{ik} G_{kj}\\\\<br> &amp;= \\sum_k (\\delta_{ik}  + h_i \\delta_{1k} + \\delta_{i1}h_k &#8211; \\delta_{i1}\\delta_{1k}h_{1})G_{kj}\\\\<br>&amp;= G_{ij} + h_i G_{1j} + \\delta_{i1}\\sum_k (h_k &#8211; \\delta_{1k} h_{1})G_{kj} \\\\<br>&amp;= G_{ij} + h_i G_{1j} + \\delta_{i1}\\left(-h_{1} G_{1j} + \\sum_k h_k G_{kj}\\right)\\\\&amp;= G_{ij} + h_i G_{1j} + \\delta_{i1} \\sum_{k&gt;1} h_k G_{kj}.<br>\\end{align}<\/p>\n\n\n\n<p>Let&#8217;s first consider the case where $i&gt;1$. Then <br>\\begin{align} G_{ij} &amp;= \\delta_{ij} &#8211; h_i G_{1j}.<br>\\end{align} Let&#8217;s define $g_j = G_{1j}$. Then rows below the top look like $I &#8211; h g^T$.<\/p>\n\n\n\n<p>Now let&#8217;s consider the case where $i=1$. Then<br>\\begin{align}<br>\\delta_{1j} &amp;= g_j + h_1 g_j + \\sum_{k&gt;1} h_k G_{kj}\\\\<br>&amp;= (1 + h_1)g_j + \\sum_{k&gt;1}h_k (\\delta_{kj} &#8211; h_k g_j)\\\\&amp;= (1 + h_1 + h_1^2 &#8211; \\|h\\|_2^2)g_j + (j&gt;1) h_j.\\end{align} So, defining $$h_0 \\triangleq 1 + h_1 + h_1^2 &#8211; \\|h\\|_2^2$$ we get \\begin{align} g_1 &amp;= {1 \\over h_0}, \\quad g_{k&gt;1} = -{h_k \\over h_0}.\\end{align} Putting it altogether we arrive at<br>$$G = I &#8211; e_1 e_1^T + ((1+h_1)e_1 &#8211; h)g^T.$$ The $I &#8211; e_1 e_1^T$ term covers the required identity term when $i&gt;1$, Here the $e_1 e_1^T$ terms subtracts the top-left 1 from the identity matrix, and the coefficients of $g^T$ are such that the first is $1$, and the remainder are $-h_2, -h_3, \\dots$ <\/p>\n\n\n\n<p>In fact, we notice that the latter vector forms the numerator of $g$. Therefore, we assign it its own symbol<br>$$\\tilde h \\triangleq [1, -h_2, -h_3, ..],$$ in terms of which $g = \\tilde h\/h_0,$ and<br>$$ \\boxed{G = I &#8211; e_1 e_1^T + {\\tilde h \\tilde h^T \\over h_0}.}$$<\/p>\n\n\n\n<p>A Colab notebook that verifies this expression is <a href=\"https:\/\/colab.research.google.com\/drive\/1aMi2ZY7AbOhlqoijIsQpC9vJCSw25MqC?usp=sharing\">here<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-right\">\u2588<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to invert a matrix of the form $$ M = I + S^2 H S^2,$$ where $H$ is a symmetric matrix, and $S^2$ is diagonal. The elements of $S^2$ drop off very quickly, so what remains of $H$ are its first column and first row, scaled by $S_{1}^2 S^2$. The result is that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,148],"tags":[39,37,36,38],"class_list":["post-1071","post","type-post","status-publish","format-standard","hentry","category-blog","category-research","tag-arrowhead","tag-arrowhead-matrices","tag-calculation","tag-matrix-inversion"],"acf":[],"_links":{"self":[{"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/posts\/1071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/comments?post=1071"}],"version-history":[{"count":87,"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/posts\/1071\/revisions"}],"predecessor-version":[{"id":1159,"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/posts\/1071\/revisions\/1159"}],"wp:attachment":[{"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/media?parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/categories?post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sinatootoonian.com\/index.php\/wp-json\/wp\/v2\/tags?post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}