{"id":3429,"date":"2015-04-12T01:28:47","date_gmt":"2015-04-12T06:28:47","guid":{"rendered":"http:\/\/www.ssc.wisc.edu\/~jfrees\/?page_id=3429"},"modified":"2015-04-19T14:31:55","modified_gmt":"2015-04-19T19:31:55","slug":"addition-and-subtraction-of-matrices","status":"publish","type":"page","link":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/regression\/basic-linear-regression\/2-9-technical-supplement-elements-of-matrix-algebra\/basic-operations\/addition-and-subtraction-of-matrices\/","title":{"rendered":"Addition and Subtraction of Matrices"},"content":{"rendered":"<p>Let \\(\\mathbf{A}\\) and \\(\\mathbf{B}\\) be matrices with dimensions \\(n\\times k\\). Use \\(a_{ij}\\) and \\(b_{ij}\\) to denote the numbers in the \\(i\\)th row and \\(j\\)th column of \\(\\mathbf{A}\\) and \\(\\mathbf{B}\\), respectively. Then, the matrix \\( \\mathbf{C}=\\mathbf{A}+\\mathbf{B}\\) is defined to be the matrix with \\( (a_{ij}+b_{ij})\\) in the \\(i\\)th row and \\(j\\)th column. Similarly, the matrix \\( \\mathbf{C}=\\mathbf{A}-\\mathbf{B}\\) is defined to be the matrix with \\( (a_{ij}-b_{ij})\\) in the \\(i\\)th row and \\(j\\)th column. Symbolically, we write this as the following.<br \/>\n\\begin{equation*} \\text{If   }\\mathbf{A=}\\left( a_{ij}\\right) _{ij}\\text{   and   } \\mathbf{B=}\\left( b_{ij}\\right) _{ij}\\text{, then} \\end{equation*}<br \/>\n\\begin{equation*} \\mathbf{C}=\\mathbf{A}+\\mathbf{B=}\\left( a_{ij}+b_{ij}\\right) _{ij}\\text{   and   }\\mathbf{C}=\\mathbf{A}-\\mathbf{B=}\\left( a_{ij}-b_{ij}\\right) _{ij}. \\end{equation*} For example, consider<br \/>\n\\begin{equation*} \\mathbf{A}=\\left( \\begin{array}{cc} 2 &#038; 5 \\\\ 4 &#038; 1 \\end{array} \\right) \\text{     }\\mathbf{B}=\\left( \\begin{array}{cc} 4 &#038; 6 \\\\ 8 &#038; 1 \\end{array} \\right). \\end{equation*} Then \\begin{equation*} \\mathbf{A}+\\mathbf{B}=\\left( \\begin{array}{cc} 6 &#038; 11 \\\\ 12 &#038; 2 \\end{array} \\right) \\text{    }\\mathbf{A}-\\mathbf{B}=\\left( \\begin{array}{cc} -2 &#038; -1 \\\\ -4 &#038; 0 \\end{array} \\right) . \\end{equation*} <\/p>\n<p> <strong>Basic Linear Regression Example of Addition and Subtraction<\/strong>. Now, recall that the basic linear regression model can be written as \\(n\\) equations:<br \/>\n\\begin{equation*} \\begin{array}{c} y_1=\\beta_0+\\beta_1x_1+\\varepsilon _1 \\\\ \\vdots \\\\ y_n=\\beta_0+\\beta_1x_n+\\varepsilon _n. \\end{array} \\end{equation*} We can define<br \/>\n\\begin{equation*} \\mathbf{y}=\\left( \\begin{array}{c} y_1 \\\\ \\vdots \\\\ y_n \\end{array} \\right) \\text{      }\\boldsymbol \\varepsilon =\\left( \\begin{array}{c} \\varepsilon _1 \\\\ \\vdots \\\\ \\varepsilon _n \\end{array} \\right) \\text{    and    }\\mathrm{E~}\\mathbf{y} =\\left( \\begin{array}{c} \\beta_0+\\beta_1x_1 \\\\ \\vdots \\\\ \\beta_0+\\beta_1x_n \\end{array} \\right) . \\end{equation*} With this notation, we can express the \\(n\\) equations more compactly as \\( \\mathbf{y=\\mathrm{E~}\\mathbf{y}+}\\boldsymbol \\varepsilon .\\) <\/p>\n<p><div class=\"alignleft\"><a href=\"https:\/\/users.ssc.wisc.edu\/~ewfrees\/regression\/basic-linear-regression\/2-9-technical-supplement-elements-of-matrix-algebra\/basic-operations\/\" title=\"Basic Operations\">&#9668 Previous page<\/a><\/div><div class=\"alignright\"><a href=\"https:\/\/users.ssc.wisc.edu\/~ewfrees\/regression\/basic-linear-regression\/2-9-technical-supplement-elements-of-matrix-algebra\/basic-operations\/matrix-multiplication\/\" title=\"Matrix Multiplication\">Next page &#9658<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let \\(\\mathbf{A}\\) and \\(\\mathbf{B}\\) be matrices with dimensions \\(n\\times k\\). Use \\(a_{ij}\\) and \\(b_{ij}\\) to denote the numbers in the \\(i\\)th row and \\(j\\)th column of \\(\\mathbf{A}\\) and \\(\\mathbf{B}\\), respectively. Then, the matrix \\( \\mathbf{C}=\\mathbf{A}+\\mathbf{B}\\) &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3423,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P8cLPd-Tj","acf":[],"_links":{"self":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/3429"}],"collection":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/comments?post=3429"}],"version-history":[{"count":3,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/3429\/revisions"}],"predecessor-version":[{"id":3432,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/3429\/revisions\/3432"}],"up":[{"embeddable":true,"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/pages\/3423"}],"wp:attachment":[{"href":"https:\/\/users.ssc.wisc.edu\/~ewfrees\/wp-json\/wp\/v2\/media?parent=3429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}