# Number of parameters in Multivariate Gaussian for different covariance matrices

In the following links : Full Covariance Gaussians, Diagonal Covariance Gaussians, Spherical Covariance Gaussians, the number of parameters is specified as $D + \frac{D(D+1)}{2}$, $2D$, $D+1$ respectively, where $D$ = # dimensions.

How do you arrive at those formulas for the number of parameters?

Thank you!

• links not working anymore Nov 17, 2020 at 6:54

For a $p$ dimensional random vector, the mean vector is of length $p$ and the covariance matrix is $p \times p$

• Full covariance: If every parameter is free, then there are $p(p+1)/2$ parameters; one way of seeing this is that there's a covariance for each pair, of which there are $$\binom{p}{2} = \frac{p!}{(p-2)! \times 2} = \frac{p(p-1)}{2}$$

then add the diagonal entries, of which there are $p$:

$$p + \binom{p}{2} = p + \frac{p(p-1)}{2} = \frac{2p + p^2 - p}{2} = \frac{p^2 + p}{2} = \frac{p(p+1)}{2}$$

• Diagonal: this means all of the off-diagonal entries are zero, so the only free parameters are on the diagonal; there are $p$ of those.

• Spherical: this means all of the off diagonal entries are 0 and the diagonal entries are all equal, so there's $1$ free parameter.

If you add in the mean parameters to be estimated, you add $p$ to each of those totals and you get $p + p(p+1)/2$, $2p$, and $p+1$, respectively.

Full: # of means = D, # of variance = D, # of covariance = (D-1)D/2: Total = D+D(D+1)/2

Diag: # of means = D, # of variance = D, covariance = 0: Total = 2D

Spherical: # of means = D, Assume the variance are the same so # of variance = 1, covariance = 0: Total = D+1