# Variance(變異數)

$$Var(x) = \frac{1}{n} \sum_{i=1}^N (x-\bar{x})^2$$

$$Var(x) = \frac{1}{n-1} \sum_{i=1}^N (x-\bar{x})^2$$

• Variance Rule 1, if y = v + w, Var(y) = Var(v) + Var(w) + 2Cov(v, w).
• Variance Rule 2, if y = az, where a is a constant, Var(y) = $a^2$Var(z).
• Variance Rule 3, if y = a, where a is a constant, Var(y) = 0.
• Variance Rule 4, if y = v + a, where a is a constant, Var(y) = Var(v).

# Standard Deviation(標準差)

$$s = \sqrt{s}$$

# Covariance(共變數)

$$Cov(x, y) = \frac{1}{n}[(x_1-\bar{x})(y_1-\bar{y}) + ... + (x_n-\bar{x})(y_n-\bar{y})] = \frac{1}{n}\sum_{i=1}^N(x_i-\bar{x})(y_i-\bar{y})$$

• Covariance Rule 1, If y = v+w, Cov(x,y) = Cov(x,v) + Cov(x,w).
• Covariance Rule 2, If y = az, where a is a constant and z is a variable, Cov(x,y) = aCov(x,z).
• Covariance Rule 3, If y = a, where a is a constant, Cov(x,y) = 0.

# Correlation Coefficient(相關係數)

$$r_{x,y} = \frac{\sqrt{Cov(x,y)}}{\sqrt{Var(x)Var(y)}}$$

correlation coefficient值介於 -1 ~ 1之間用來判斷兩個變數的正相關 or 負相關.

The covariance depends on the units in which the variables x and y happen to be measured, whereas the correlation coefficient does not.