Verifying the correctness simplifying an equation?

40 Views Asked by At

Give a $N \times N$ matrix $ P=(p_{i j})$; I defined a clustering criterion as follows.

$ Q = \rho_{g} \sum_{i, j}(\lambda^2 m_{i}^2 m_{j}^2 - 2 \lambda p_{i j} m_{i} m_{j} )$ where $\lambda = \frac{\sum_{i, j} p_{ij} m_{i} m_{j}} {\sum_{i} m_{i}^2 \sum_{j}m_{j}^2}$ and $ \mathbf{m} = (m_{i})$ for i=1, 2, ..., N ($\mathbf{m}$ is a binary cluster membership vector.

I would like to simplify this equation and I know at least two ways for doing that. The problem is these two ways give me different results. Below I write the one which I think is correct. May you please verify its correctness.

$\textbf{First way which I think is correct}$

then substituting $\lambda$'s definition and applying the summation we have

$ Q = \rho_{g} \frac{(\sum_{i j} p_{i j} m_{i} m_{j})^{2}} {(\sum_{i} m_{i}^{2} \sum_{j} m_{j}^{2})^2} \times (\sum_{i} m_{i}^{2} \sum_{j} m_{j}^{2}) - 2 \rho_{g} \frac{\sum_{i j} p_{i j} m_{i} m_{j}} {(\sum_{i} m_{i}^{2} \sum_{j} m_{j}^{2})} \times \sum_{i j} p_{i j} m_{i} m_{j} \\ = \rho_{g} \frac{(\sum_{i j} p_{i j} m_{i} m_{j})^{2}} {\sum_{i} m_{i}^{2} \sum_{j} m_{j}^{2}} - 2 \rho_{g} \frac{(\sum_{i j} p_{i j} m_{i} m_{j})^{2}} {\sum_{i} m_{i}^{2} \sum_{j} m_{j}^{2}} = - \rho_{g} \frac{(\sum_{i j} p_{i j} m_{i} m_{j})^{2}} {\sum_{i} m_{i}^{2} \sum_{j} m_{j}^{2}} \\ = - \rho_{g} \lambda \sum_{i j} p_{i j} m_{i} m_{j}$

1

There are 1 best solutions below

1
On BEST ANSWER

Your simplification is entirely correct. The only improvement I could suggest is to write the expressions in terms of the vector $m=(m_1,\ldots,m_n)$ and matrix $P$ to reduce the clutter of notation. Also note that $$\sum_im_i^2\sum_jm_j^2=\big(\sum_im_i^2\big)^2.$$ In terms of $m$ and $P$ we have $$\sum_{ij}p_{ij}m_im_j=mPm\qquad\text{ and }\qquad \sum_im_i^2=||m||^2.$$ Then your simplification above can be expressed more succinctly as $\lambda=\tfrac{mPm}{||m||^4}$ and \begin{eqnarray*} Q&=&\rho_g\frac{(mPm)^{2}}{||m||^8}\times||m||^4 -2\rho_g\frac{mPm}{||m^||^4}mPm \\ &=&\rho_g\frac{(mPm)^{2}}{||m||^4} -2\rho_g\frac{(mPm)^{2}} {||m||^4}\\ &=&-\rho_g\frac{(mPm)^2} {||m||^4} \\ &=& - \rho_{g} \lambda mPm. \end{eqnarray*}