这篇用于记录一些学习中遇到的细碎知识。大多不是主要领域的知识,所以并未系统地学习和整理,权当备忘和随笔啦。
Quaternion & Rotations
Python 2 vs 3
(For using Mininet…) Essential coding differences that may sometimes disturb me:
print a
-print(a)
- Integer
/
division → \rightarrow → integer - → \rightarrow → float xrange()
iterating -range()
Julia
Notes about Julia during the 6.S083 course at MIT:
- Dynamic + Compiled (high-performance)
- Good for data science tasks
- But lacks robustness in some cases 😭, e.g.
- Lack of index out-of-bound checks
- Need to follow performance tips, o.w. can perform really bad
- Greek (Unicode) symbols allowed, looks like math 😉
- Some functional programming properties
- No OOP, functions live outside
- Multi-dispatch: function is a name and methods are its different variants of signatures
- Mutation guard by
!
Array{}
enables 1/multi-dimensional storageVector{}
is a 1d array- Index starts from
1
😭 - Matlab-flavor
.
operators
- Index starts from
- Matrices can be represented as a multi-d array
Julia looks like a strange hybrid of Python + Matlab + Lisp to me. But its spirit is great, and it is developing really fast. I like it.
Statistics
- 中心极限定理:对一个总体,做无穷次同样大小样本的抽样,这些样本的均值会呈现一种正态分布
- 该正态分布的均值即总体的均值(i.e., 样本均值是对总体均值的无偏估计)
- 该正态分布的标准差即标准误(Standard Error,SE),代表了我随意抽一次样本,这个样本的均值大概会离总体均值有多远的误差
- 标准误 SE = σ n \frac{\sigma}{\sqrt{n}} nσ, σ \sigma σ 为总体标准差, n n n 为样本容量
- 但总体标准差不可知,故使用所抽样本的标准差 s s s 代替,则标准误 SE ≈ s n \approx \frac{s}{\sqrt{n}} ≈ns
- 总体遵循对称的分布时,样本标准差 s s s 更接近总体标准差 σ \sigma σ(总体若是遵循 skew 的分布,如指数分布,则这个近似会不太精确);同时,所抽样本容量越大,近似更精确;故当我们对总体遵循的分布有一个事先的认识的情况下,若知道总体是 skew 的(如遵循指数规律),则应选取较大的样本大小,从而使 “使用所抽样本的标准差 s s s 代替总体标准差 σ \sigma σ” 这一行为更为精确
- 95% 置信区间 即抽出的样本的均值 ± \pm ± 1.96 SE,代表了我有 95% 的信心保证下次抽样的均值应该在这个区间内
将一切未知都交给 random 是一种聪明但有些懒惰的做法 (?)。
Dual Number & Differentiation
二元数(Dual Number): a + b ϵ