# LDA的直观解释

$\ln{\frac{P(Y=1|X=x)}{P(Y=0|X=x)}} = \ln{\frac{\pi_1 \exp{\{-\frac{1}{2}(x-\mu_1)^T\Sigma^{-1}(x-\mu_1)\}}} {\pi_0 \exp{\{-\frac{1}{2}(x-\mu_0)^T\Sigma^{-1}(x-\mu_0)\}}}} \\ = \left[-\frac{1}{2}(x-\mu_1)^T\Sigma^{-1}(x-\mu_1) + \ln \pi_1 \right] - \left[-\frac{1}{2}(x-\mu_0)^T\Sigma^{-1}(x-\mu_0) + \ln \pi_0 \right]$

$\delta_k(x) = -(x-\mu_k)^T\Sigma^{-1}(x-\mu_k) + 2\ln \pi_k,k=0,1$

$\delta_1(x) \ge \delta_0$

$(x-\mu_k)^T\Sigma^{-1}(x-\mu_k)$

$\max_k \delta_k(x) \Leftrightarrow \min_k\ (x-\mu_k)^T\Sigma^{-1}(x-\mu_k) - 2\ln \pi_k$

## NSC

NSC全称是Nearest Shrunken Centroid，是2002年提出来的方法。这个方法判别函数保持不变
$\delta_k(x) = -(x-\mu_k)^T\Sigma^{-1}(x-\mu_k) + 2\ln \pi_k,k=0,1$

$\hat{D}=diag(\hat{\Sigma}) + s_0^2 I_d$

$\frac{\sum_{i=1}^n x_{ij}}{n}+m_k(s_j+s_0)t_{kj}',j=1,\cdots,d,k=1,2$

$m_k = \sqrt{\frac{1}{n_k} + \frac{1}{n}} , s_j^2 = \hat{\Sigma}_{jj} \\ t_{kj}'=sgn(t^*_{kj})(t^*_{kj}-\Delta), t_{kj}^* = \frac{\hat{\mu}_{kj} -\hat{\bar{\mu}}_j }{m_k(s_j+s_0)}$

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客