本文介绍矩阵一些相关概念的直观理解,包括行列式、矩阵乘法、特征值、特征向量,这将有助于实际问题的建模求解。
1. 线性代数与矩阵
线性代数是抽象代数的一类,抽象代数研究的对象是代数结构,代数结构可以理解成集合+一套用运算规则。向量空间(vector space)也叫线性空间(linear space),是代数结构的一种,详情可参考之前博文《代数结构入门:群、环、域、向量空间》。
向量空间是由许多向量(即集合,向量是除了具有数值还同时具有方向的量)组成的并且符合某些特定运算的规则的集合(一套运算规则,叫线性变换linear mappings)。向量空间中的运算对象是向量而不是数,其运算性质也不同于初等代数的四则运算。
n维线性空间中n个线性无关的向量可以构成该线性空间的一组基,选定了一组基,集合中的每个元素(即向量)就可以被唯一表示了。想像下,欧几里德的三维空间,选定了坐标系(如[1,0,0]、[0,1,0]、[0,0,1]),空间内的任一个点都可以被唯一表示成(a,b,c)。
矩阵(matrix)可以视为由一组同维行向量或列向量组成,线性变换(linear transformations)可以写成矩阵的形式。但值得注意的是矩阵理论与线性代数是有很大区别的,区别在于:线性代数是在选定一组基的前提下进行讨论的。摘抄mathoverflow上的一个回答(原文在这里):
When you talk about matrices, you’re allowed to talk about things like the entry in the 3rd row and 4th column, and so forth. In this setting, matrices are useful for representing things like transition probabilities in a Markov chain, where each entry indicates the probability of transitioning from one state to another.
In linear algebra, however, you instead talk about linear transformations, which are not a list of numbers, although sometimes it is convenient to use a particular matrix to write down a linear transformation. However, when you’re given a linear transformation, you’re not allowed to ask for things like the entry in its 3rd row and 4th column because questions like these depend on a choice of basis. Instead, you’re only allowed to ask for things that don’t depend on the basis, such as the rank, the trace, the determinant, or the set of eigenvalues. This point of view may seem unnecessarily restrictive, but it is fundamental to a deeper understanding of pure mathematics.
线性关系(Linearity)是指两变量可以表示成一次方函数关系,在坐标系中呈现一条直线,即需要满足两个条件:可加性 + 齐次性。维基百科原文如下:
Additivity: f(x + y) = f(x) + f(y).
Homogeneity of degree 1: f(αx) = αf(x) for all α.
2. 从线性方程到矩阵
以如下函数为例,xyz表示3种水果的数量,345分别表示其价钱,那么F就表示总价钱。假设买xyz分别是1、2、3斤,那么总价钱就是F(1,2,3)=3*1+4*2+5*3=26。
假设现在3个人都买了这3种水果,数量分别是(1,2,3)、(2,1,3)、(3,2,1),总价钱则为26、25、22。可以用矩阵表示(Ax=y):
可见,线性方程计算可以表示成矩阵的运算,更加直观。我的理解是:将线性方程表示成矩阵,旨在便于大规模的处理数据,即批处理。从上图还可以看出,矩阵的乘法是将行乘以列,下图更清晰地表达了矩阵乘法的直观理解(图片来源于这里):
图1 矩阵乘法的直观理解
再进一步,假设物价上涨,xyz分别上涨到7、8、9,这三个人买的数量还一样,那么可以得到:
相对于前面,现在将操作(operation)也扩展到多维,可以进一步批处理了。到这里,如果还有点懵,可以移步至BetterExplained一篇博文An Intuitive Guide to Linear Algebra的A Non-Vector Example: Stock Market Portfolios例子。
操作组成的矩阵实为线性变换,即对input?????????
3. 线性变换
线性变换(linear transformation)也叫线性映射(linear mappings),是向量空间对应的一套运算规则。
3.1 标量乘法
标量乘法(scalar multiplication)比较好理解,将矩阵的所有元素都缩放。想想线性(Linearity)的齐次性(另一个特性是可加性):
Homogeneity of degree 1: f(αx) = αf(x) for all α.
也可以理解成将坐标轴或者一组基同程度放大或缩小。
3.2 加法
既然是线性,就满足可加性特性,即:
Additivity: f(x + y) = f(x) + f(y).
两矩阵相加就是两矩阵对应元素相加,想想两个函数相加,相同变量的系数相加。矩阵加法满足:
- 加法结合律:u + (v + w) = (u + v) + w
- 加法的单位元:V存在零向量的0,∀ v ∈ V , v + 0 = v
- 加法的逆元素:∀v∈V, ∃w∈V,使得 v + w = 0
- 加法交换律:v + w = w + v
3.3 矩阵乘法
了解矩阵乘法之前,先从向量乘法开始,事实上向量可以看成只有一行或者一列的矩阵(行向量和列向量对应于行矩阵和列矩阵)。
http://blog.stata.com/2011/03/03/understanding-matrices-intuitively-part-1/
如何变换
全部放大
拉伸
translation, but no rotation, scaling, or skew.
http://math.stackexchange.com/questions/31725/intuition-behind-matrix-multiplication
BetterExplained: An Intuitive Guide to Linear Algebra
1. Matrix multiputation
http://mathinsight.org/matrices_linear_transformations
http://betterexplained.com/articles/linear-algebra-guide/
http://blog.stata.com/2011/03/03/understanding-matrices-intuitively-part-1/
http://mathinsight.org/matrices_linear_transformations
http://math.stackexchange.com/questions/31725/intuition-behind-matrix-multiplication
BetterExplained: An Intuitive Guide to Linear Algebra
Blog: We Recommend a Singular Value Decomposition
This article offers a geometric explanation of singular value decompositions and look at some of the applications of them.
参考资料:
[1]WolframMathworld: Linear Transformation
微信赞赏
支付宝赞赏