r""" Compute the probability density function of a multivariate Gaussian distribution. Parameters ---------- x : array-like, shape (..., d) The input samples. m : array-like, shape (d,) The mean vector of the Gaussian distribution. C : array-like, shape (
(x, m, C)
| 49 | |
| 50 | |
| 51 | def gaussian_pdf(x, m, C): |
| 52 | r""" |
| 53 | Compute the probability density function of a multivariate |
| 54 | Gaussian distribution. |
| 55 | |
| 56 | Parameters |
| 57 | ---------- |
| 58 | x : array-like, shape (..., d) |
| 59 | The input samples. |
| 60 | m : array-like, shape (d,) |
| 61 | The mean vector of the Gaussian distribution. |
| 62 | C : array-like, shape (d, d) |
| 63 | The covariance matrix of the Gaussian distribution. |
| 64 | |
| 65 | Returns |
| 66 | ------- |
| 67 | pdf : array-like, shape (...,) |
| 68 | The probability density function evaluated at each sample. |
| 69 | |
| 70 | """ |
| 71 | return get_backend(x, m, C).exp(gaussian_logpdf(x, m, C)) |
| 72 | |
| 73 | |
| 74 | def gmm_pdf(x, m, C, w): |