矩阵分解

Download Report

Transcript 矩阵分解

生物信息学基础讲座
第3讲 生物信息学与数学
微积分
calculus
函数function

一元函数
y  f  x

多元函数
y  f  x1 , x2 ,
, xn 
极限limit
| f  x   L |  for x : | x  x0 | 
lim f  x   L
x  x0

上式中的L即为函数f(x)在x0处的极限
导数derivative
导数的几何意义
函数曲线在该点处切线
(tangent)的斜率
(slope)
f  x2   f  x1 
dy
 lim
dx x2  x1
x2  x1
f  x1  x   f  x1 
= lim
x  0
x
y
= lim
x 0 x
dy d f ( x)

 f ' x
dx
dx
导数的规则rules for derivatives

加法规则addition rule
h  x  f  x  g  x
h ' x  f ' x  g ' x
h  z   f  z  , z=g  x 



传递原则chain rule
乘法原则multiplication rule
除法原则division rule
h '  g  x   f '  g  x  g '  x 
h  x  f  x g  x
h ' x  f ' x g  x  f  x g ' x
h  x  f  x / g  x
h ' x 
g  x f ' x  g ' x f  x
 g  x 
2
Applied calculus
变化Change: 常导数ordinary 、偏导数partial和
方向导数directional derivatives
 最优化optimization:包括拟合fitting和带约束的
优化constrained optimization
 建模modeling






函数类型:线性linear、多项式polynomial、指数
exponential、三角trigonometric、幂power-law
多元函数multi-variables function
微分方程differential equation
单位和维度units and dimension
例子:二元二次多项式
微分方程:动态过程建模
Differential Equation
动态模型dynamic model





描述研究对象特征随时间/空间变化的演变过程
分析研究对象特征的变化规律
预测研究对象特征的未来状态
控制研究对象特征的未来状态
微分方程建模方法



根据函数及其变化率(导数)的关系建模
根据建模目的和问题分析简化假设
根据内在规律(模式)或类比法建立微分方程
线性代数:矩阵之美
Linear Algebra
基本概念






集合(set)
线性空间(linear space)
线性组合(linear combination)
线性相关(linear independent)
欧式空间(Euclidean space)
正交(perpendicular,orthogonal)
向量的加法(addition)
其实质是对应元素的加法
 交换律(communicative law)
 结合律(associative law)
 分配率(distributive law)


向量加减的几何学意义(geometric
interpretation)
向量乘法(multiplication)的几何意义
内积(inner product):也称作点乘(dot product),
其结果为一标量(scalar),相当于a的范数(L2-norm)
与b的范数的乘积乘以两向量的夹角余弦值,表示为
<a, b> 或 a·b
 应用:计算物理上的做功。
 外积(outer product):也称作叉乘(cross product),
其结果为垂直于向量a与b形成的的平面的向量,其范数
为向量a和b范数的乘积乘以夹角的正弦值,表示为
a×b
 应用:物理上的电磁力计算,确定方向采用右手螺
旋方法

矩阵(matrix)








A R
m n
矩阵的秩(rank):矩阵A的行(或列)极大无关组的个数,表示
为rank(A),rank(A) <= min(m, n)。如果等式成立,则称A是满秩
(full rank)的(行满秩还是列满秩取决于m、n大小);如果
rank(A)=m=n,则称A为n阶非奇异方阵(n-order nonsingular
square matrix),此时A可逆(invertible)。
方阵的行列式(determinant),表示为det(A)。矩阵非奇异的充要
条件是:det(A)<>0
矩阵的转置(transpose matrix)
逆矩阵(inverse matrix)
对称矩阵(symmetric matrix)
正交矩阵(orthonormal matrix)
正定矩阵(positive definite matrix)
正半定矩阵(positive semidefinite matrix)
矩阵分解(decomposition/factorization)
所谓矩阵分解,是将矩阵分解为经典矩阵(canonical matrix)的乘积的
办法,目的是为了简化计算。
 LU分解:将矩阵分解为下三角矩阵(upper triangular matrix,L)和
上三角矩阵(upper triangular matrix ,U)的乘积,常用于方程组的
求解。通常A为方阵
 QR分解:将矩阵分解为一个正规正交矩阵(Q)和一个上三角矩阵的
积(R)。QR分解常用来求解线性最小二乘问题。矩阵不必为方阵,
分解得到Q为m×m方阵,R为n×n方阵
 Cholesky分解:
 特征值分解(eigendecomposition):
 Schur分解:
 奇异值分解(singular value decomposition, SVD):A=USVT,其中
U、V为正规正交矩阵,S为对角阵。是最为准确的矩阵分解方法,可
用于主成份分析(PCA)和聚类(clustering)
最优化:理论与应用
Optimization Theory &
Applications
数学规划(mathematical programming)
min f ( x), x  R ,
n
s.t. c i  x   0, i  1, 2,
, l ,
ci  x   0, i  l  1, l  2,



, l  m
最优化理论的一个重要分支
数学规划是指对n个变量对单目标(或多目标)函数
求解极小值(或极大值)
变量可能受到某些条件(等式或不等式)的约束
优化问题:分类
线性规划+非线性规划(二次规划等)
 凸规划+非凸规划
 全局(global)优化和局部(local)优化
 带约束的优化+不带约束的优化



无约束优化应用:最小二乘法(ordinary least
squares, OLS)
带约束的优化应用:LASSO(least absolute
shrinkage and selection operator)
线性规划(linear programming)
目标函数(objective)和约束函数(constraint)
都是线性的
 方法(solutions)






图解法(graphical method)
单纯形法(Simplex method)
修正单纯形法(Modified Simplex method)
对偶单纯形法(dual Simplex method)
应用:
二次规划(quadratic programming)
概率论:赌场中产生的科学
Probability
统计:科学还是骗术?
Statistics:Cheating Tools?
Descriptive statistics

Continuous data




Location: mean, median, mode
Dispersion: range, standard deviation, coefficient of
variation, percentile
Moments: variance, semivariance, skewness,
kurtosis
Categorical data


Frequency
Contingency table
Statistical graphics







bar plot
biplot
boxplot
Histogram
Stemplot
Q-Qplot
correlogram
Mathematics can be beautiful …
barplot
boxplot
Pairs plot
Perspective plot
Time series data decomposition
Stem plot
1 | 1111112222233444
1 | 5555556666667899999
2 | 3344
2 | 59
3|
3 | 5678
4 | 012
随机过程:从偶然到必然
Stochastic Process
马尔可夫链(Markov Chain)





有向无环图(Directed Acyclic
Graph, DAG)
可用于预测(prediction)与分类
(classification)
每条有向边为量化的可信度(或者
概率)
是马尔可夫链(Markov chain,
MC)的扩展(extension或
generalization)
每个节点概率的计算,可用贝叶斯
公式计算;与马尔可夫链相似,每
个状态值取决于前面有限个状态
贝叶斯网络(Bayesian Network)





有向无环图(Directed Acyclic
Graph, DAG)
可用于预测(prediction)与分类
(classification)
每条有向边为量化的可信度(或者
概率)
是马尔可夫链(Markov chain,
MC)的扩展(extension或
generalization)
每个节点概率的计算,可用贝叶斯
公式计算;与马尔可夫链相似,每
个状态值取决于前面有限个状态
图论:树与网络
Graph Theory
Classification minds
(apple, orange, banana, watermelon,
grape, grapefruit, mango, star fruit)
 Clustering or classification?
