**If you only know yourself, but not your opponent, you may win or may lose. If you know neither yourself nor your enemy, you will always endanger yourself** – idiom, from Sunzi’s Art of War
* ![{\displaystyle {\bar {\y}}} = {\frac {1}{m}}\sum _{i=1}^{m}y_{i}](img/791424a3e5f6e2f4372471d96e5b4676.jpg) : the mean of ![\y](img/afa87c5126806e604709f243ab72848b.jpg).
* ![\y](img/afa87c5126806e604709f243ab72848b.jpg) : the label vector.
* ![\hat{\y}](img/bab25b7785bf747bc1caa1442874df74.jpg) : the predicted label vector.
## 6.2\. 线性代数预备
## 6.2\. Linear Algebra Preliminaries
Since I have documented the Linear Algebra Preliminaries in my Prelim Exam note for Numerical Analysis, the interested reader is referred to [[Feng2014]](reference.html#feng2014) for more details (Figure. [Linear Algebra Preliminaries](#fig-linear-algebra)).
In statistics, **MAE** ([Mean absolute error](https://en.wikipedia.org/wiki/Mean_absolute_error)) is a measure of difference between two continuous variables. The Mean Absolute Error is given by:
In statistics, the **MSE** ([Mean Squared Error](https://en.wikipedia.org/wiki/Mean_squared_error)) of an estimator (of a procedure for estimating an unobserved quantity) measures the average of the squares of the errors or deviations—that is, the difference between the estimator and what is estimated.
In statistical data analysis the **TSS** ([Total Sum of Squares](https://en.wikipedia.org/wiki/Total_sum_of_squares)) is a quantity that appears as part of a standard way of presenting results of such analyses. It is defined as being the sum, over all observations, of the squared differences of each observation from the overall mean.
In statistics, the **ESS** ([Explained sum of squares](https://en.wikipedia.org/wiki/Explained_sum_of_squares)), alternatively known as the model sum of squares or sum of squares due to regression.
In statistics, **RSS** ([Residual sum of squares](https://en.wikipedia.org/wiki/Residual_sum_of_squares)), also known as the sum of squared residuals (SSR) or the sum of squared errors of prediction (SSE), is the sum of the squares of residuals which is given by:
In general (![\y^{T}{\bar {\y}}={\hat {\y}}^{T}{\bar {\y}}](img/b288f19072faa2f8f373d5a8910c080b.jpg)), total sum of squares = explained sum of squares + residual sum of squares, i.e.:
![\text{TSS} = \text{ESS} + \text{RSS} \text{ if and only if } {\displaystyle \y^{T}{\bar {\y}}={\hat {\y}}^{T}{\bar {\y}}}.](img/4a1a112aa8490f7c8410b710845e8c7a.jpg)
More details can be found at [Partitioning in the general ordinary least squares model](https://en.wikipedia.org/wiki/Explained_sum_of_squares).
* Pearson correlation: Tests for the strength of the association between two continuous variables.
* Spearman correlation: Tests for the strength of the association between two ordinal variables (does not rely on the assumption of normal distributed data).
*Chi-square: Tests for the strength of the association between two categorical variables.
* Pearson 互相关: 检验两个连续变量之间的相关度。
* Spearman 互相关: 检验两个序数变量之间的相关度(不依赖于正态分布数据的假设)。
*卡方: 检验两个类别变量之间的相关度。
### 6.5.2\. Comparison of Means test
### 6.5.2\. 均值检验的比较
*Paired T-test: Tests for difference between two related variables.
*Independent T-test: Tests for difference between two independent variables.
* ANOVA: Tests the difference between group means after any other variance in the outcome variable is accounted for.
*配对 T 检验: 检验两个相关变量之间的差异
*独立 T 检验: 检验两个独立变量之间的差异
* ANOVA: 在考虑结果变量中的任何其他变化之后,检验组均值之间的差异。
### 6.5.3\. Non-parametric Test
### 6.5.3\. 非配对检验
* Wilcoxon rank-sum test: Tests for difference between two independent variables - takes into account magnitude and direction of difference.
* Wilcoxon sign-rank test: Tests for difference between two related variables - takes into account magnitude and direction of difference.
* Sign test: Tests if two related variables are different – ignores magnitude of change, only takes into account direction.