1 Normal distribution

11 Univariate

A random variable is said to have a normal distribution with mean and variance if its probability density function (pdf) is given by

where is the mean and is the variance of the distribution. More compactly, it can be written as

12 Uncorrelated multivariate

A random vector is said to have an uncorrelated multivariate normal distribution with mean and variances if the pdf of every random component of is given by

where is the mean and is the variance of the -th component. The uncorrelated multivariate normal distribution is a special case of the general multivariate normal. When components are uncorrelated, the covariance matrix is diagonal, which simplifies many calculations.

All components of are assumed to be independent, so the joint pdf of is the product of the pdfs of its components:

13 Covariance matrix

All variance parameters can be combined into a covariance matrix . The covariance matrix is a symmetric positive definite matrix that describes the covariance between the components of .

Here, the covariance matrix is diagonal (all off-diagonal elements are zero), because we assumed that the components of are uncorrelated, i.e., for all .

The pdf of the multivariate normal distribution can be written in terms of the covariance matrix:

For a sample , the variance is the average of the squared differences from the mean:

Given another sample , the co-variance between two samples is characterized by how much they vary together:

Both per sample variance and two samples covariance can be combined into a covariance matrix.

It will be shown below that this is equivalent to the covariance matrix for a sample of 2D vectors .

The covariance matrix above is a diagonal matrix, but in general, itโ€™s a symmetric positive definite matrix that describes the covariance between the components of :

If we substitute the non-diagonal covariance matrix into the pdf, we get the general form of the multivariate normal distribution.

To characterize co-variance of multiple samples

all together, we combine them into one sample of -dimensional data:

The covariance between any two samples and is

Generally, for a sample of vectors :

which resembles the variance but in multiple dimensions.

Technically, each component of is the covariance between the corresponding components

The term is the generalized variance.

14 Mahalanobis distance

The distance between a point and the distribution can be measured using the Mahalanobis distance.

Quadratic form is a scalar function of a vector that can be expressed as a weighted sum of the squares of the components of :

These weights can be gathered into a matrix , and the quadratic form can be written as a matrix product:

The premise is that the covariance matrix captures the correlations between the components of . The Mahalanobis distance is a measure of how many standard deviations away a point is from the mean , taking into account the correlations between the components of .

We can define a quadratic form

The square root of this quadratic form is the Mahalanobis distance between a point and the distribution .

2 Multivariate Normal Distribution

21 General form

The probability density function of the multivariate normal distribution is given by:

where:

In compact notation, this is written as:

22 Uncorrelated components

When the components of the distribution are uncorrelated:

This has geometric implications - the axes of the probability density ellipsoid are parallel to the coordinate axes.

The covariance matrix simplifies to a diagonal matrix:

For uncorrelated components, the multivariate normal pdf can be expressed as a product of univariate normal pdfs:

This factorization enables simpler parameter estimation methods.

23 Decorrelation transformation

Decorrelation is a critical preprocessing step in many machine learning applications. It simplifies the data by removing linear dependencies between features.

For correlated components, we need to find a transformation that makes the components uncorrelated. When components of a multivariate normal distribution are correlated, the covariance matrix is not diagonal.

To decorrelate the components:

  1. Apply spectral decomposition to the covariance matrix (a special case of SVD for symmetric matrices):

  1. The quadratic form can be rewritten as:
  1. Define the decorrelation transformation:

  1. The transformed parameters are:
  1. To transform parameters back to the original space:

For orthogonal (rotation) matrices:

3 Parameter Estimation for Normal Distribution

31 Maximum likelihood estimation

When a sample is generated from a Gaussian distribution, we can estimate its parameters using maximum likelihood estimation:

The MLE estimates are asymptotically unbiased and efficient, making them optimal for large samples. For smaller samples, however, the covariance estimate is biased.

32 Multicollinearity issues

Multicollinearity is a statistical phenomenon where two or more predictor variables in a model are highly correlated. This creates redundant information that doesnโ€™t contribute uniquely to the modelโ€™s explanatory power.

When estimating parameters from data, multicollinearity can cause problems:

Solutions to multicollinearity include:

  1. Reducing the number of features through feature selection methods (PCA, SFS, etc.)
  2. Increasing the sample size
  3. Adding regularization to the covariance matrix:

  1. Assuming uncorrelated features (diagonal covariance matrix)

4 Non-parametric Density Estimation

41 Parametric vs non-parametric approaches

The choice between parametric and non-parametric methods involves a bias-variance tradeoff. Parametric methods generally have higher bias but lower variance, while non-parametric methods have lower bias but higher variance.

Parametric methods for density estimation assume a specific distribution shape (e.g., normal), which simplifies calculations and requires less data. However, they can be inaccurate if the actual data distribution differs significantly from the assumed form and are limited in capturing complex structures.

Non-parametric methods offer greater flexibility and can provide more accurate estimates for complex and multimodal distributions without assuming a specific form. However, they typically require larger data sets, are more computationally intensive, and their results are harder to interpret due to the lack of explicit parameters.

42 Empirical density estimator

The simplest non-parametric estimator for a probability density function is:

and for the cumulative distribution function:

where:

43 Histogram density estimator

A more practical approach divides the feature space into bins:

and for the CDF:

where:

44 Window averaging

The choice of window width is critical in kernel density estimation and presents the classic bias-variance tradeoff.

Instead of bins, we can use a window function centered at each data point:

and for the CDF:

where:

5 Kernel Density Estimation

51 Parzen-Rosenblatt window method

Kernel density estimation is often called the Parzen-Rosenblatt window method after its developers Emanuel Parzen and Murray Rosenblatt.

There are two main approaches for multivariate density estimation:

  1. Product kernel approach (assumes local independence):
  1. Multivariate kernel approach:

where:

52 Kernel functions

Several standard kernel functions are used in practice:

The Epanechnikov kernel is theoretically optimal in terms of mean integrated squared error, but in practice, the choice of kernel usually has less impact than the bandwidth selection.

53 Bandwidth selection

The optimal bandwidth can be found by minimizing the cross-validation criterion:

where:

Cross-validation provides a data-driven approach to bandwidth selection, avoiding both oversmoothing and undersmoothing.

This approach:

  1. Excludes each point from the training set
  2. Estimates the density at that point using the remaining points
  3. Minimizes the negative log-likelihood of these estimates

54 Relationship to other methods

The connection between these methods highlights the unified theoretical foundation underlying non-parametric approaches.

Kernel methods form a common framework that includes:

  1. Density estimation:
  2. Classification (Parzen window):
  3. Regression (Nadaraya-Watson):

In these methods:

6 Mixture Models

61 Definition

Mixture models provide a flexible framework that can approximate any continuous distribution with arbitrary precision.

A mixture model combines multiple probability distributions:

where:

62 Parameter estimation

The log-likelihood function for a mixture model is:

where:

Direct optimization is challenging because the logarithm of a sum doesnโ€™t simplify easily. The EM algorithm provides an iterative solution.

63 Fixed point method

The fixed point method underlies many iterative algorithms in machine learning, including the EM algorithm.

Before introducing EM, itโ€™s helpful to understand the fixed point iteration method:

This method converges if:

where is the fixed point such that .

7 Expectation-Maximization Algorithm

71 EM algorithm

The EM algorithm was formalized by Dempster, Laird, and Rubin in 1977, though similar approaches had been used earlier.

The EM algorithm iteratively optimizes parameters and for mixture components. Each iteration consists of two steps:

  1. Expectation step (E-step): Calculate the posterior probability for each data point:
  1. Maximization step (M-step): Update parameters:

72 Theoretical foundation

The EM algorithm can be derived using the Lagrangian function and Karush-Kuhn-Tucker conditions.

The EM algorithm optimizes a Lagrangian function:

where:

73 Variants of EM

Generalized EM (GEM) relaxes the maximization requirement:

Stochastic EM (SEM) optimizes parameters using sampled subsets:

74 Determining the number of components

Several approaches can determine the optimal number of distributions in a mixture:

  1. Greedy addition: Start with fewer components; add new components if the likelihood for some data points is below a threshold
  2. Greedy deletion: Start with more components; remove components with small weights
  3. AddDel: Combination of both approaches
  4. Regularization: Use cross-entropy regularization to encourage sparsity in component weights

Information criteria like AIC or BIC can also be used to select the optimal number of components, balancing model complexity with goodness-of-fit.

75 Hierarchical EM

Hierarchical EM extends the standard algorithm to restore hierarchical relationships in the data. It operates by greedily adding components and splitting components with low likelihood. This approach is useful for clustering and enhancing data understanding by revealing structure where single clusters may have multiple subclusters.

8 Comparing Density Estimation Methods

81 Framework comparison

Different approaches to density estimation include:

  1. Parametric: Assumes a specific functional form

  1. Non-parametric kernel: Based on local estimations around each training point

  1. Mixture models: Combines multiple distributions

Mixture models provide a unified framework - when , they reduce to parametric methods, and as approaches the sample size, they approximate non-parametric methods.

These approaches represent a spectrum: mixture models generalize both parametric methods (when ) and non-parametric approaches (when equals the sample size).

References