Covariance matrix
A covariance matrix is a square matrix whose diagonal entries are variances and whose off-diagonal entries are pairwise covariances among variables.
Math and Architectures of Deep Learning
A matrix summarizing variances and covariances among dimensions.
- How it is used
- Characterizes multidimensional data spread for PCA, Gaussian distributions, mixture models, and stochastic latent-space mappings.
- How deep it goes
- Derives directional variance as a quadratic form and connects eigendecomposition and SVD to PCA computation.
- Examples
- Uses two- and three-dimensional point sets, mean-centered data matrices, Gaussian point clouds, GMM clusters, and a PyTorch multivariate normal.
- What you can do after
- Evaluate/understand directional spread, principal axes, Gaussian shapes, and covariance-based PCA computations.
Read how Math and Architectures of Deep Learning explains covariance matrix →
Build a Robo-Advisor with Python (From Scratch)
A covariance matrix is a square symmetric matrix containing asset variances on its diagonal and pairwise covariances off the diagonal.
- How it is used
- Supplies the portfolio-risk input for volatility calculation, asset allocation, and optimization.
- How deep it goes
- Defines matrix entries, derives portfolio volatility, implements construction, and notes estimation and validity limits.
- Examples
- Uses three-asset correlation and volatility inputs, FE/WMT/AAPL historical returns, and a two-asset risk-parity portfolio.
- What you can do after
- Apply it via NumPy or pandas to estimate covariance and calculate portfolio volatility.
Read how Build a Robo-Advisor with Python (From Scratch) explains covariance matrix →
Outlier Detection in Python
A covariance matrix is a square matrix containing the variances of variables on its diagonal and their pairwise covariances elsewhere.
- How it is used
- Uses feature spread and correlation to model data shape for distance-based outlier detection.
- How deep it goes
- Defines the matrix, explains its geometric and distance-scoring roles, and demonstrates robust estimation without deriving covariance calculations.
- Examples
- Fits MinCovDet to three correlated features and enlarges Gaussian-mixture covariance matrices to generate wider-ranging synthetic data.
- What you can do after
- Apply it via scikit-learn’s MinCovDet to estimate data shape and score Mahalanobis distances, while checking single-cluster assumptions.
Read how Outlier Detection in Python explains covariance matrix →
Bayesian Optimization in Action
A covariance matrix is a matrix whose diagonal contains variances and whose off-diagonal entries contain covariances between components of a multivariate random variable.
- How it is used
- Uses covariance matrices to model relationships and uncertainty among variables in multivariate Gaussian distributions.
- How deep it goes
- Defines diagonal and off-diagonal meanings, then illustrates distance-dependent covariance and conditioning without deriving matrix computations.
- Examples
- Uses housing prices, a 20-dimensional street model, covariance heat maps, and conditioned Gaussian visualizations.
- What you can do after
- Evaluate how observed variables should update predictions and uncertainty for correlated variables.
Read how Bayesian Optimization in Action explains covariance matrix →
Data Without Labels
A covariance matrix is a square matrix whose entries represent pairwise covariances among variables.
- How it is used
- Uses pairwise covariances to describe feature relationships while PCA reduces redundancy.
- How deep it goes
- Explains covariance through PCA’s redundancy-reduction objective without detailing matrix construction or computation.
- Examples
- Uses house-price variables and linear combinations of area, bedrooms, distance, and schools.
- What you can do after
- Evaluate how PCA reduces feature redundancy by minimizing covariance between feature pairs.
Build AI Drug Discovery Pipelines
A covariance matrix is a square matrix whose entries quantify pairwise covariance between features.
- How it is used
- Uses pairwise feature relationships as the computational basis for PCA-based dimensionality reduction.
- How deep it goes
- Explains covariance directionality and its role in PCA eigendecomposition, but stops short of deriving the matrix formula.
- Examples
- Uses molecular feature datasets, rotated coordinates, and principal-component visualizations to illustrate covariance-driven compression.
- What you can do after
- Evaluate/understand how feature co-variation determines PCA directions and affects the choice of retained components.
Read how Build AI Drug Discovery Pipelines explains covariance matrix →
Also covered in
- Grokking BayesIn early access (MEAP)
- Machine Learning Algorithms in Depth
- Privacy-Preserving Machine Learning
- Natural Language Processing in Action, Second Edition
What to know first
- likelihoodA likelihood is the probability of observed data under a model, viewed as a function of the model’s parameters or candidate hypotheses.
- high-dimensional dataHigh-dimensional data consists of observations represented by a large number of features, variables, coordinates, or other dimensions.
- normal distributionA normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
- varianceVariance is the expected squared deviation of a random variable from its mean and measures the dispersion of its values.
Related concepts
- principal component analysisused by · Principal component analysis is a linear statistical technique that represents data along orthogonal directions, called principal components, ordered by the variance they capture.
- normal distributionpart of · A normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
- Gaussian mixture modelused by · A Gaussian mixture model is a probabilistic model that represents a distribution as a weighted combination of Gaussian component distributions.
- Gaussian processused by · A Gaussian process is a probability distribution over functions in which every finite collection of function values has a joint Gaussian distribution.
Questions about covariance matrix
What is covariance matrix?
A covariance matrix is a square matrix whose diagonal entries are variances and whose off-diagonal entries are pairwise covariances among variables.
Which Manning books explain covariance matrix?
Math and Architectures of Deep Learning, Build a Robo-Advisor with Python (From Scratch), Outlier Detection in Python, Bayesian Optimization in Action, Data Without Labels and Build AI Drug Discovery Pipelines.
What should I know before learning covariance matrix?
Manning books that teach covariance matrix usually introduce likelihood, high-dimensional data, normal distribution and variance first.
What kinds of covariance matrix are there?
Kinds of covariance matrix include diagonal covariance matrix.
What is covariance matrix part of?
Covariance matrix is part of normal distribution. A normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
What is covariance matrix also called?
Covariance matrix is also called covariance matrices.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





