2 minute read

Scalar, Norm, Matrix (Inverse, Basic Functions), Rank

One of my previous courses: Machine Learning Statistics Review

image

ML Stat Review

Scalar

  • An element of a field which is used to define a vector space

Vector

  • A mathematical object that has both a magnitude and direction

  • Two vectors are the same, if they have - the same magnitude & direction - if they are the same, their cosine similarity is 1

Matrix

  • A matrix is an array of numbers sized โ€˜m by nโ€™. - m = #rows, n = #columns

Norm

image-20240501185552837

Matrix Operations

  • Unit vector: a vector of length 1, also called normalized vector

  • How do we convert a vector into a unit vector?

    dotproduct

  • Dot product (inner product) of vectors
    Multiply corresponding entries of two vectors and add up the result โ€”> useful for a proxy for the angle between two vectors (Ex. If B is a unit vector, then A*B gives the length of A which lies in the direction of B)
  • Product of two matrices
    matrix multiplication is associative & distributive & not commutative
  • Transpose: A matrix flipped over its diagonal
    Useful for Rotation, Scaling, and Data Manipulation.

Determinant

  • Can only be calculated for square matrices
  • Useful: The area of an n-dimensional parallelogram is the determinant

Matrix Inverse

  • When the determinant is zero, a matrix is not invertible.
  • How useful?
    We can multiply a matrix by its inverse.

Pseudoinverse ์œ ์‚ฌ์—ญํ–‰๋ ฌ (Explained by Korean)

  • If you want to use an inversed Matrix even though it is not a Square Matrix (Square Matrix๊ฐ€ ์•„๋‹Œ ๊ฒฝ์šฐ์—๋„ ์—ญํ–‰๋ ฌ์„ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์„ ๊ฒฝ์šฐ)
  • Generalized inverse or Moore-Penrose inverse (ํŠน์ด๊ฐ’ ๋ถ„ํ•ด(Single Value Decomposition svd)๋ฅผ ์ด์šฉํ•˜๋ฉด ๋ฌด์–ด-ํŽœ๋กœ์ฆˆ ์œ ์‚ฌ ์—ญํ–‰๋ ฌ์„ ์‰ฝ๊ฒŒ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋‹ค)
  • Use:
    • Compute a โ€˜best fitโ€™ solution to a system of linear equations.
    • Find the minimum norm solution to a system of linear equations.
  • Matrix is non-invertible: matrices are sparse( have many zero) / very large / very small.

Linear (in)dependence

  • Linear independence: No vector is a linear combination of the other vectors
  • Common cause: One of the vectors is a null vector , Or the vectors are perpendicular to each other

Matrix Rank

  • The maximum number of linearly independent column vectors
  • ๐ถ๐‘œ๐‘™ โˆ’ ๐‘Ÿ๐‘Ž๐‘›๐‘˜ ๐ด = ๐‘…๐‘œ๐‘ค โˆ’ ๐‘Ÿ๐‘Ž๐‘›๐‘˜(๐ด) (always!)
  • Rank tells the dimension of an output (when you want to transform a matrix)
  • If a square matrix (m x m) is rank m, we say itโ€™s โ€™full rank.โ€™
  • If rank < m, we say itโ€™s โ€˜singular.โ€™
    • At least one dimension is a linear combination of another dimension
    • There is no inverse

image2

Leave a comment