zf
Data Matrices and Manipulation
2011-10-16 2
cxt
Presentation Outline
? 1,Matrices and vectors
? 2,Random vector
? 3,Multivariate data matrix
? 4,Population mean vector,covariance and correlation
matrices
? 5,Sample mean vector,covariance and correlation matrices
? 6,Euclidean,statistical and Mahalanobis distances
2011-10-16 3
cxt
1,Matrices and vectors
? A matrix of size n p is a rectangular array of
numbers with n rows and p columns of the
form( n 行 p列 矩阵 )
?
2011-10-16 4
cxt
2011-10-16 5
cxt
2011-10-16 6
cxt
? If n = p,then this is a square matrix( 方阵 ),
? If a matrix has only one column,then this is
called a column vector( 列向量 ),
? If there is only one row,then this is called a
row vector.( 行向量 )
2011-10-16 7
cxt
? Transpose of a Matrix( 转置矩阵)
denoted by a prime,is found by interchanging the
rows and the columns.( 将矩阵的行和列交换 )
The transpose of A,C and R above are,
2011-10-16 8
cxt
? 例,给定一个矩阵 A,
矩阵 A的 转置矩阵是??
2011-10-16 9
cxt
其他特殊矩阵形式和定义,
? A zero matrix has all elements equal to zero.( 零
矩阵 )
? A diagonal matrix is a square matrix that has
elements of zero,except down the main diagonal.
( 对角矩阵 )
000
000
000
??
??
????
1 0 0
0 2 0
0 0 5
??
??
????
2011-10-16 10
cxt
? A symmetric matrix is a square matrix that is
unchanged when it is transposed I.e,A’=A.( 对称
矩阵 — 矩阵的转置和它本身相等)
2011-10-16 11
cxt
? An identity matrix (I) is a diagonal matrix with
all diagonal terms being unity.( 单位矩阵)
2011-10-16 12
cxt
? An inverse matrix ( 逆矩阵)
To a square matrix A,if a square matrix B
exists and AB=BA=I,Then B is the inverse
matrix of A(or A is the inverse matrix of B)
2011-10-16 13
cxt
? The trace of a matrix is the sum of the diagonal
terms ( 矩阵的迹), This is only defined for
square matrices,
? 例:给定一个矩阵 A,
? 求矩阵 A的迹?
tr(A)= =a+b
1 ii
p
i
a
?
?
2011-10-16 14
cxt
? 矩阵运算
( 1) Matrix Addition and Subtraction( 矩
阵加法和减法)
例,
2011-10-16 15
cxt
? 续例 1,
? 欲求每人、每科两次考试的总分数,
即把两个矩阵的对应元素相加。
? Matrices with different dimensions cannot be
added or subtracted.( 只有当两个矩阵同行数、
同列数时,才能相加减。)
2011-10-16 16
cxt
? ( 2) Matrix Multiplication( 矩阵乘法)
? Scalar Multiplication( 数乘运算),
续例 1:求每人每科两次考试的平均成绩
2011-10-16 17
cxt
? Matrix Multiplication( 矩阵乘法 ),
? To multiply two matrices,the column dimension of the
matrix on the left must equal the row dimension of the
matrix on the right( 两个矩阵相乘,第一个矩阵的列数
必须等于第二个矩阵的行数 ),
2011-10-16 18
cxt
2011-10-16 19
cxt
2011-10-16 20
cxt
? ( 3) Matrix Multiplication Algebra( 矩阵乘法的
代数式)
(AB)’ = B’A’ (Note reversal of positions)
In general,AB is not equal to BA,
AB = 0 does not imply A= 0 or B = 0
If A = 0 or B =0 then AB = 0,
2011-10-16 21
cxt
Determinant and Inverse of a Matrix( 矩阵行列式和逆矩阵),
? 1,Determinant of a matrix( 矩阵行列式 ),
2011-10-16 22
cxt
? 2,The inverse of a matrix( 逆矩阵)
To a square matrix A,if a square matrix B exists
and AB=BA=I,Then B is the inverse matrix of
A(or A is the inverse matrix of B)
2011-10-16 23
cxt
? For a square matrix A,we may find its inverse such
that = I,
? The inverse of a matrix is not defined if its determinant
is equal to zero( 如果方阵的行列式等于 0,则该方
阵无逆矩阵 ),
? A matrix with a zero determinant is described as being
singular( 如果方阵的行列式等于 0,则称该方阵为
奇异矩阵;否则,为非奇异矩阵 nonsingular ),
?A matrix A is orthogonal if and only if ( 如果 A的
逆矩阵等于其转置矩阵,则称矩阵 A正交 )
2011-10-16 24
cxt
? 二阶逆矩阵运算,
2011-10-16 25
cxt
例,
2011-10-16 26
cxt
Eigenvalues and Eigenvectors( 向量与特征向量),
? Let A be an n n square matrix and I be the n n identity
matrix,Then the scalars satisfying the polynomial
equation are called eigenvalues of a matrix
A( 特征值)
? The equation is called the characteristic
equation(特征方程),
? If C is a nonzero vector such that AC= 或
then C is said to be an eigenvector (特征向量 ) of the
matrix A associated with the eigenvalue,
? The sum of the eigenvalues of A is equal to the trace of A
? ?
C? ( ) 0A I C???
?
2011-10-16 27
cxt
2011-10-16 28
cxt
2011-10-16 29
cxt
2011-10-16 30
cxt
? 例,Find the eigenvalues and eigenvectors of
2011-10-16 31
cxt
2011-10-16 32
cxt
2,Random Vector( 随机向量)
2011-10-16 33
cxt
3,Multivariate Data Matrix(多元数据矩阵)
2011-10-16 34
cxt
4,mean vector,covariance and correlation matrices
( 均值向量、协方差、相关系数矩阵)-总体
2011-10-16 35
cxt
2011-10-16 36
cxt
4,mean vector,covariance and correlation matrices
( 均值向量、协方差、相关系数矩阵)-样本
2011-10-16 37
cxt
2011-10-16 38
cxt
2011-10-16 39
cxt
2011-10-16 40
cxt
2011-10-16 41
cxt
2011-10-16 42
cxt
2011-10-16 43
cxt
5、欧氏距离与马氏距离