title: Math
#+startup: content
Statistic
Gauss distribution
标准高斯分布的积分包含了高斯积分
Co-variance matrix 协方差矩阵
<<covariance matrix link for ML>> for i = {1...n}, is a random variable, which belong to Gaussian distribution
set
co-variance matrix
\begin{equation}
\Sigma =
\left(
\begin{array}{c}
x_{1}-\bar{x}_{1} \\
x_{2}-\bar{x}_{2} \\
x_{3}-\bar{x}_{3} \\
.. \\
x_{n}-\bar{x}_{n}
\end{array}
\right)
\left(
\begin{array}{ccccc}
x_{1}-\bar{x}_{1} &
x_{2}-\bar{x}_{2} &
x_{3}-\bar{x}_{3} &
.. &
x_{n}-\bar{x}_{n}
\end{array}
\right)
\end{equation}
对角线上是对应元素的方差,其他是相对于两个元素的协方差
Maximun likelihood
according to the given example finding the most likely distribution model
1, assign each instance a probability to be happen
2, descripte the the probability of all such instance happens
3, logarithm the probability
4, partial derivative the logarithm
5, set the partial derivative to be 0, get the probability in 1 step
linear Argebra
Matrix
Graph
digraph diagramm {
TransposeMatrix -> orthogonalMatrix[label = "A^TA = AA^T = 1"];
TransposeMatrix -> SymmetryMatrix[label= "A=A^{T}"];
SymmetryMatrix -> HermitianMatrix[label= "A=A^{H}"];
HermitianMatrix -> positivedefinitematrix;
ConjugatetransposeMatrix -> NormalMatrix[label = "A*A = AA*"];
NormalMatrix -> UnitaryMatrix[label = "A*A = AA* =1"] ;
Einzelwertzerlegung -> Diagroal [label = "SVD"] ;
Eigenwertzerlegung -> Diagroal [label = "for real and symmetrisch"];
Diagroal -> Unitaryzerlegung [label ="A=VIV*,I:identity"];
}
transpose Matrix
symmetry conjugate
symmetry and complex conjugate matr
Symmetry Matrix
orthogonal matrix
实数酉矩阵 得该矩阵的转置矩阵为其逆矩阵
Hermitian matrix
A = symmetry conjugate of A (共轭对称) ,
埃尔米特矩阵,厄米特矩阵,厄米矩阵,所有元素对称出共轭
Conjugate transpose Matrix
共轭转置矩阵, 先共轭再转置,还是先转置再共轭都可以。
Normal Matrix
正定矩阵, 是转置和本身满足交换律 可酉变换
Unitary Matrix
酉矩阵,是正定矩阵, 即转置和本身满足交换律,而且等于 I
Eigenwertzerlegung
对于矩阵求特征值特征向量,特征值分解,但是要求必须是方阵,如果不是,先 要转换: A = a*a.T
import numpy as np
a = np.mat([[1,2,3,4],[1,1,1,1]])
A = a*a.T
B, U = np.linalg.eig(A)
print("eigenvalue of A : ")
print(B)
print("eigenvalue of a :(should be equal to the following) ")
print(np.sqrt(B))
print("eigenvactor : ")
print(U)
Einzelwertzerlegung
但是对于一般矩阵,不是方阵,可以奇异值分解:
import numpy as np
a = np.mat([[1,2,3,4],[1,1,1,1]])
U, B, Vt = np.linalg.svd(a)
print("left eigenvalue : ")
print(U)
print("eigenvactor of a : ")
print(B)
print("right eigenvalue : ")
print(Vt)
Transform
Jacobin matrix
wikipedia chinese link englich link
for , 由球坐标系到直角坐标系的转化由 F: ℝ+ × [0, π] × [0, 2π) → ℝ3 函数给出, 其分量为: 此坐标变换的雅可比矩阵是 其雅可比行列式为 r2 sin θ,由于 dV = dx dy dz,如果做变数变换的话其体 积元(Volume element),dV,会变成:dV = r2 sin θ dr dθ dφ。
Advanced Math Method
Fourier Problem
Fourier Series
任意周期函数都可以写成若干正余弦函数在不同频率的叠加, 假设目标函数为 so
or
And There is series orthometric basis (1, , ).
f(x) can also be wrote with complex form, , where
Fourier Transfromation
set , we use to multipy all terms in , which invokes factor .
SO and its inverse transfromation:
Laplace Transfromation
If ,we can use to eliminate divergence.
Laplace transfromation :
or , where
note: firstly force to convergence, then fourier transfromed.
Z-transform
where is the extractly continue signal function, presents that we only measured at time Kt, shows us all the measurements at time of...-2T, -T, 0, T, 2T, 3T...
The Fourier Transform of the measurements are ,
for , , this is Z Transform aber , , this is Distinct Fourier Transform
Distinct Fourier Transform
for , where , we only consider that, f(x) only has N items, from k=0, to N-1, and we has exactly N measurements points, , and we image that those N points is exactly in a period,which is from 0 to , so... set Here it is
\begin{equation}
\left( \begin{array}{c}
f_{0} \\
f_{1} \\
f_{2} \\
....\\
f_{N}
\end{array} \right)
=
\left(
\begin{array}{ccccc}
1 & 1 & 1 & ...& 1\\
1 & w & w^{2} & ...& w^{N-1}\\
1 & w^{2} & w^{4} & ...& w^{2(N-1)}\\
...&...&...&...&...\\
1 & w^{N-1} & w^{2(N-1)} & ...& w^{(N-1)(N-1)}\\
\end{array}
\right)
\left(
\begin{array}{c}
C_{0} \\
C_{1} \\
C_{2} \\
....\\
C_{N}
\end{array}
\right)
\end{equation}
We can have exactly all coefficient of C.
if we have only N measurements, but we want to have a general solution for all possible items of f(t), for ,
\begin{equation}
\left( \begin{array}{c}
f_{0} \\
f_{1} \\
f_{2} \\
....\\
f_{N}
\end{array} \right)
=
\left[
\begin{array}{ccccc}
1 & 1 & 1 & ...& 1\\
1 & w & w^{2} & ...& w^{N-1}\\
1 & w^{2} & w^{4} & ...& w^{2(N-1)}\\
...&...&...&...&...\\
1 & w^{N-1} & w^{2(N-1)} & ...& w^{(N-1)(N-1)}\\
\end{array}
\right]
\left(
\begin{array}{c}
...+C_{-N} + C_{0}+C_{N}+... \\
...+C_{-N+1}+ C_{1}+C_{N+1}+... \\
...+C_{-N+2}+ C_{2}+C_{N+2}+... \\
...\\
...+C_{-1}+ C_{N-1}+C_{2N-1} +...
\end{array}
\right)
\end{equation}
All possible solutions can be satisfied. denote matrix as Fourier Matrix: F, ,
Fast Fourier Transform
we here only consider about , so denote it as ,
\begin{equation}
F_{4} =
\left[
\begin{array}{cccc}
1 & 1 & 1 & 1\\
1 & w & w^{2} & w^{3}\\
1 & w^{2} & w^{4}& w^{6)}\\
1 & w^{3} & w^{6}& w^{9}\\
\end{array}
\right]
\end{equation}
\begin{equation}
\bar{F}_{4} =
\left[
\begin{array}{cccc}
1 & 1 & 1 & 1\\
1 & w^{2} & w & w^{3}\\
1 & w^{4} & w^{2}& w^{6)}\\
1 & w^{6} & w^{3}& w^{9}\\
\end{array}
\right]
=
\left[
\begin{array}{cc}
F_{2} & D_{2}F_{2}\\
F_{2} & -D_{2}F_{2}
\end{array}
\right]
\end{equation}
always recursive to , that is
Convolution law
Green function propagate function segment
convolution
Kalman Filter
descripation
For a continus system we can estimate the next predict state based on current optimized (best, precise) state and its uncertainies. if there is next observe state, we can combine them to a next optimized state and get its uncertainies, and ready for next iterative.
Estimatation Function:
stands for the state, with stands for the state Operator with stands for contoller operator is the current system uncertainies and with
Revise Function:
stands for the observe state, with stands for Observe Operator with is the observation uncertainies and with H = , , , ,
kalman filter process
assumpation: we know current state , and its uncertainies
- estimatation
all with
2, kalman filter calcaletation with : because Numerator has and denominator has
3, Revise resulte
python code
# _*_ coding:utf-8 _*_
import numpy as np
import matplotlib.pyplot as plt
# 创建一个0-99的一维矩阵
z = [i for i in range(100)]
z_watch = np.mat(z)
#print(np.array(z).shape)
#print(np.array(z_watch).shape)
# 创建一个方差为1的高斯噪声,精确到小数点后两位
noise = np.round(np.random.normal(0, 1, 100), 2)
noise_mat = np.mat(noise)
# print(noise_mat)
# 将z的观测值和噪声相加
z_mat = z_watch + noise_mat
#print(z_mat)
# 定义x的初始状态
x_mat = np.mat([[0, ], [0, ]])
# print(x_mat)
# 定义初始状态协方差矩阵
p_mat = np.mat([[1, 0], [0, 1]])
# 定义状态转移矩阵,因为每秒钟采一次样,所以delta_t = 1
f_mat = np.mat([[1, 1], [0, 1]])
# 定义状态转移协方差矩阵,这里我们把协方差设置的很小,因为觉得状态转移矩阵准确度高
q_mat = np.mat([[0.0001, 0], [0, 0.0001]])
# 定义观测矩阵
h_mat = np.mat([1, 0])
# 定义观测噪声协方差
r_mat = np.mat([1])
for i in range(100):
x_predict = f_mat * x_mat
p_predict = f_mat * p_mat * f_mat.T + q_mat
kalman = p_predict * h_mat.T / (h_mat * p_predict * h_mat.T + r_mat)
x_mat = x_predict + kalman * (z_mat[0, i] - h_mat * x_predict)
p_mat = (np.eye(2) - kalman * h_mat) * p_predict
plt.plot(x_mat[0, 0], x_mat[1, 0], 'ro', markersize=1)
plt.show()
Grope Theorie
sammlungen von Grope
- G本身和单位元称为G的平凡子集
- 群的元素个数称为群的阶
- 群的阶数是素数,则该群一定是循环群
- 有限群的子集的阶数是该有限群的阶数的约数
- 在置换群中,任何一个轮换都可以用其他的对换组合来实现
- 在置换群中,如果一个置换能通过奇(偶)数次对换得到,那么它只能有奇 (偶)数次对换得到
- 在一个置换群中,可以奇置换和偶置换的个数应给相等
- 由偶置换可以得到一个交错群(包括与单元群的置换)
- 阿贝尔群
- 元素 左乘H的每一个元素得到的就叫: 元素 关于H的左陪集
- 右陪集亦然, 左右陪集可以不相等
- 子群H中每个元素作用于群G,得到的左右陪集都相等,则称H为G的正规子群
- G本身和单位元{e}肯定都是正规子集,但是成为平凡正规子群
- 只有群中有正规子集,这该群中肯定存在一个相应的对称
- 阿贝尔群的子群肯定是正规子群
- 只有当H是正规子群是,商群G/H才是一个群,否则只是一个空间
- 单群,没有正规子群的群,是群论中的最小单元