Definitions
Correlation and Covariance Matrices
\[ Cov_{a,b} = \sigma_a\sigma_b\rho_{a,b} \tag{1}\]
where \(\rho_{a,b}\) is the correlation of \(a\) and \(b\)
\(\sigma_{a}\), \(\sigma_{b}\) are the standard deviations of \(a\) and \(b\) respectively
\[ Cov_{a,b} = \frac{1}{2}\sum\limits_{i=1}^n({a_i - \hat{a}})(b_i-\hat{b}) \]
where \(\hat{a}\), \(\hat{b}\) are the means of \(a\) and \(b\) respectively
\[ \rho_{a,b} = \frac{Cov_{a,b}}{\sigma_a\sigma_b} \]
The correlation (covariance) matrix is the pairwise correlation (covariance) for each asset. For a three asset example:
\[ \begin{bmatrix} \rho_{a,a} & \rho_{a,b} & \rho_{a,c} \\ \rho_{b,a} & \rho_{b,b} & \rho_{b,c} \\ \rho_{c,a} & \rho_{c,b} & \rho_{c,c} \end{bmatrix} \]