You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

notation and operations form the backbone of linear regression analysis. They provide a compact way to represent and manipulate data, making complex calculations more manageable. Understanding these concepts is crucial for grasping the mathematical foundations of regression models.

In the context of simple linear regression, matrices allow us to express the relationship between variables efficiently. They enable us to solve systems of equations, estimate coefficients, and analyze model performance using powerful mathematical tools and techniques.

Matrix basics and notation

Matrix fundamentals

Top images from around the web for Matrix fundamentals
Top images from around the web for Matrix fundamentals
  • A matrix is a rectangular array of numbers, symbols, or expressions arranged in rows and columns
    • Enclosed by square brackets or parentheses
    • Denoted as A=[aij]A = [a_{ij}] or A=(aij)A = (a_{ij}), where aija_{ij} represents the element in the ii-th row and jj-th column
  • The size of a matrix is defined by the number of rows and columns it contains
    • Denoted as m×nm \times n, where mm is the number of rows and nn is the number of columns
    • Example: A 3×43 \times 4 matrix has 3 rows and 4 columns
  • Each element in a matrix is identified by its position, specified by the row and column indices
    • The element in the ii-th row and jj-th column is denoted as aija_{ij}
    • Example: In a matrix AA, the element a23a_{23} is located in the 2nd row and 3rd column

Vectors

  • A is a one-dimensional array of numbers, symbols, or expressions
    • Represented as either a (1×n1 \times n) or a (m×1m \times 1)
    • Denoted as v=(v1,v2,,vn)\vec{v} = (v_1, v_2, \ldots, v_n) for a row vector or v=[v1,v2,,vm]T\vec{v} = [v_1, v_2, \ldots, v_m]^T for a column vector
  • Vectors can be considered special cases of matrices
    • A row vector is a matrix with only one row
    • A column vector is a matrix with only one column

Applications of matrices and vectors

  • Matrices and vectors can be used to represent various mathematical and real-world concepts
    • Systems of linear equations
    • Linear transformations and geometric transformations
    • Data in fields such as mathematics, physics, computer science, and economics
  • Example: A system of linear equations can be represented using a coefficient matrix and a constant vector
    • 2x+3y=52x + 3y = 5 and 4xy=34x - y = 3 can be represented as [2341][xy]=[53]\begin{bmatrix} 2 & 3 \\ 4 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 5 \\ 3 \end{bmatrix}

Matrix operations

Addition and subtraction

  • and subtraction can only be performed on matrices of the same size
    • The resulting matrix has the same size as the input matrices
  • To add or subtract matrices, add or subtract the corresponding elements in each position
    • For matrices AA and BB, C=A+BC = A + B implies cij=aij+bijc_{ij} = a_{ij} + b_{ij} for all ii and jj
    • Example: [1234]+[5678]=[681012]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix}
  • Scalar multiplication of a matrix involves multiplying each element of the matrix by a scalar value
    • For a scalar kk and matrix AA, the resulting matrix B=kAB = kA has elements bij=kaijb_{ij} = ka_{ij} for all ii and jj
    • Example: 2[1234]=[2468]2 \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} = \begin{bmatrix} 2 & 4 \\ 6 & 8 \end{bmatrix}

Matrix multiplication

  • can be performed between two matrices AA (m×nm \times n) and BB (n×pn \times p)
    • The number of columns in the first matrix must equal the number of rows in the second matrix
    • The resulting matrix CC has dimensions (m×pm \times p)
  • To multiply matrices, multiply each element of a row in the first matrix by the corresponding element of a column in the second matrix and sum the products
    • The element cijc_{ij} is given by the dot product of the ii-th row of AA and the jj-th column of BB
    • cij=k=1naikbkjc_{ij} = \sum_{k=1}^n a_{ik}b_{kj}
  • Example: [1234][5678]=[19224350]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}

Solving linear systems

Augmented matrix and Gaussian elimination

  • A system of linear equations can be represented using an
    • Consists of the coefficient matrix and the constant terms
    • Example: The system 2x+3y=52x + 3y = 5 and 4xy=34x - y = 3 can be represented as the augmented matrix [235413]\left[\begin{array}{cc|c} 2 & 3 & 5 \\ 4 & -1 & 3 \end{array}\right]
  • is a method for solving systems of linear equations
    • Performs elementary row operations on the augmented matrix to obtain an upper triangular matrix
    • Elementary row operations include swapping rows, multiplying a row by a non-zero constant, and adding a multiple of one row to another
    • These operations do not change the solution set of the system
  • Back-substitution is used to solve for the variables once the augmented matrix is in row echelon form
    • Row echelon form is an upper triangular matrix with ones on the diagonal and zeros below the diagonal

Cramer's rule

  • is another method for solving systems of linear equations using determinants
    • Applicable when the system has a unique solution and the coefficient matrix is square and invertible
  • For a system of nn linear equations with nn unknowns, Cramer's rule states that the solution for the ii-th variable xix_i is given by:
    • xi=det(Ai)det(A)x_i = \frac{\det(A_i)}{\det(A)}, where AA is the coefficient matrix and AiA_i is the matrix formed by replacing the ii-th column of AA with the constant terms
  • Example: For the system 2x+3y=52x + 3y = 5 and 4xy=34x - y = 3, the solution using Cramer's rule is:
    • x=det[5331]det[2341]=811=811x = \frac{\det\begin{bmatrix} 5 & 3 \\ 3 & -1 \end{bmatrix}}{\det\begin{bmatrix} 2 & 3 \\ 4 & -1 \end{bmatrix}} = \frac{-8}{-11} = \frac{8}{11} and y=det[2543]det[2341]=711=711y = \frac{\det\begin{bmatrix} 2 & 5 \\ 4 & 3 \end{bmatrix}}{\det\begin{bmatrix} 2 & 3 \\ 4 & -1 \end{bmatrix}} = \frac{-7}{-11} = \frac{7}{11}

Properties of matrix operations

Commutativity and associativity

  • Matrix addition and subtraction are commutative
    • A+B=B+AA + B = B + A and AB=(BA)A - B = -(B - A) for matrices AA and BB
  • Matrix multiplication is associative, but not commutative
    • (AB)C=A(BC)(AB)C = A(BC), but ABBAAB \neq BA in general
  • Example: Let A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} and B=[5678]B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}
    • AB=[19224350]AB = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}, but BA=[23343146]BA = \begin{bmatrix} 23 & 34 \\ 31 & 46 \end{bmatrix}

Identity matrix and inverse matrix

  • The , denoted as II, is a square matrix with ones on the main diagonal and zeros elsewhere
    • It has the property AI=IA=AAI = IA = A for any matrix AA
    • Example: [1001]\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} is a 2×22 \times 2 identity matrix
  • A square matrix AA is invertible if there exists a matrix BB such that AB=BA=IAB = BA = I
    • The inverse of AA is unique and denoted as A1A^{-1}
    • Not all square matrices have inverses
  • Example: The inverse of [1234]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} is [213212]\begin{bmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{bmatrix}

Transpose and determinant

  • The transpose of a matrix AA, denoted as ATA^T, is obtained by interchanging the rows and columns of AA
    • For matrix multiplication, (AB)T=BTAT(AB)^T = B^T A^T
    • Example: If A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, then AT=[1324]A^T = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}
  • The of a square matrix AA, denoted as det(A)\det(A) or A|A|, is a scalar value that provides information about the matrix's properties
    • Invertibility: A matrix is invertible if and only if its determinant is non-zero
    • Linear independence: The columns or rows of a matrix are linearly independent if and only if the determinant is non-zero
  • Example: For the matrix A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, det(A)=1423=2\det(A) = 1 \cdot 4 - 2 \cdot 3 = -2
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary