This is a study note of the course Mathematics for Machine Learning: Linear Algebra on the coursera. In this part, we will learn what matrices is, and operations in matrices. We can make transformations by using mactrices, and find the inverse of a matrix. In addition, the determinants will be explaned in this section.
Matrix
How matrices transform space
Given a vector r=[xy] , and a 2×2 matrix A .
Start with Ar=r′
We know r=[xy]=xe1^+ye2^
where e1^ and e2^ are basic vectors, that is e1^=[10] and e2^=[01].
Then, we getAr=A(xe1^+ye2^)=xAe1^+yAe2^
So we have made a transformation by using matrix A. We change the basic vector e1^ to Ae1^, and e2^ to Ae2^.
If we assume matrix A=[acbd].
We get Ae1^=[acbd][10]=[ac], and Ae2^=[acbd][01]=[cd].
Finally, we change the basis to the columns of matrix A.
Then, we can say the basis after changing are the columns of matrix A.
Types of matrix transformations
Stretching
The matrix associated with a stretch by a factor k along the x-axis is given by: [k001]
Similarly, a stretch by a factor k along is given by: [100k]
Squeezing
If the two stretches above are combined with reciprocal values, then the transformation matrix represents a squeeze mapping: [k001/k]
A square with sides parallel to axes is transformed to a rectangle that has the same area as the square. The reciprocal stretch and compression leave the area invariant.
Rotation
For rotation by an angle θ clockwise about the origin the functional form is x′=xcosθ+ysinθ and y′=−xsinθ+ycosθ. Written in matrix form, this becomes: [cosθ−sinθsinθcosθ]
Similarly, for a rotation counterclockwise about the origin, the functional form is x′=xcosθ−ysinθ and y′=xsinθ+ycosθ the matrix form is: [cosθsinθ−sinθcosθ]