Skip to main content

Vector

we first define vector which is a collection of data in n×1n\times1 as [x1x2x3xn]\begin{bmatrix}x_1\\ x_2\\x_3\\\vdots\\x_n\end{bmatrix}, and matrix is a collection of data in n×pn\times p as [x11x12x1px21x22x2pxn1xn2xnp]\begin{bmatrix}x_{11} & x_{12} & \cdots & x_{1p} \\ x_{21} & x_{22} & \cdots & x_{2p} \\ \cdots & \cdots & \cdots & \cdots \\x_{n1} & x_{n2} & \cdots & x_{np}\end{bmatrix}

  • Just in case, n×pn\times p means nn rows and pp column

We define a transpose of a matrix(the example from above) is [x11x21xn1x1px2pxnp]\begin{bmatrix} x_{11} & x_{21} & \cdots & x_{n1} \\ \cdots & \cdots & \cdots & \cdots \\ x_{1p} & x_{2p} & \cdots & x_{np}\end{bmatrix} which from n×pn\times p to p×np\times n, we also denote as vTv^T or vv'

Since we have vector, we also has its belong, the vector space. In the most of courses, vector spaces are defined over the field R\R, moreover over the n-dimensional Euclidean space Rn\R^n

Vector space also contain operation of those vector.

Add: if x,yx, y with the same row pp, then we can add them together where x+y=[x1+y1x2+y2xn+yn]x + y = \begin{bmatrix}x_1 + y_1 \\ x_2 + y_2 \\ \vdots \\ x_n + y_n \end{bmatrix}

Product with constant: if cR,xc\in \R, x is a vector of p×1p \times 1, then we have cx=[cx1cx2cxn]cx = \begin{bmatrix}cx_1 \\ cx_2 \\ \vdots \\ cx_n\end{bmatrix}

Inner Product: Let x,yx,y be the p×1p\times 1 vector, the inner/dot product xyx\cdot y is defined as x,y=i=1pxiyi=xy=yx\langle x, y\rangle = \sum_{i = 1}^p x_i y_i = x'y = y'x

  • ax+by,cz+dw=acx,z+bcy,z+adx,w+bdy,w\langle ax + by,cz + d w\rangle = ac\langle x,z\rangle + bc\langle y,z\rangle + ad\langle x,w\rangle + bd\langle y,w\rangle
  • Let AA be a p×pp\times p matrix, Ax,y=x,Ay\langle Ax,y\rangle = \langle x,A'y\rangle
  • We define the length/norm of a vector xx as Lx=x=x,xL_x = ||x|| = \sqrt{\langle x,x\rangle}; if we have y=cxy = cx, then Ly=cLxL_y = |c| L_x
  • We can also obtain a unit vector xˉ=1||\bar x|| = 1 by xˉ=Lx1x=xx,x\bar x = L_x^{-1}x = \frac{x}{\sqrt{\langle x,x\rangle}}

Cross Product: Let x,yx,y be the p×1p\times 1 vector, the cross product x×yx\times y is defined as absin(θ)n||a||||b||\sin(\theta) n

  • nn is the unit vector perpendicular to the plane containing xx and yy
  • θ\theta is the angle between xx and yy where cos(θ)=x,yLxLy,x,y=0    xy\cos(\theta) = \frac{\langle x,y\rangle}{L_xL_y}, \langle x,y\rangle = 0 \implies x\perp y which shows xx and yy perpendicular to each other

We can also project a vector to the other. Denote the projection of vector xx on yy as Lxcos(θ)=x,yy,yy=x,yyˉL_x|\cos(\theta)|= \frac{\langle x,y\rangle}{\langle y,y\rangle}y = \langle x,y\rangle\bar y

Cauchy-Schwarz Inequality: (xy)(xx)(yy)(x'y) \le (x'x)(y'y)

We say x1,x2,,xkx_1, x_2, \ldots, x_k are linearly independent if c1x1+c2x2++ckxk=0    c1=c2==ck=0c_1x_1 + c_2x_2 + \ldots + c_kx_k = 0 \iff c_1= c_2 =\ldots =c_k = 0. Else they are linearly dependent