Covariance analysis results
Calculated results appear here.
Interactive covariance heatmap
Full matrixHover for values. Click a cell to inspect its variable pair.
Selected pair inspection
Covariance matrix
Variable statistics
Interpretation and diagnostics
Formula used
Sample covariance measures joint variation using an n minus one denominator. Population covariance uses n when observations represent the complete population. Weighted covariance gives observations influence through positive weights.
Sample covariance:
Cov(X,Y) = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / (n − 1)
Population covariance:
Cov(X,Y) = Σ[(xᵢ − μₓ)(yᵢ − μᵧ)] / n
How to use this calculator
- Paste data or upload a CSV or TSV file.
- Preview the dataset and select numeric variables.
- Choose missing-value, preprocessing, and covariance settings.
- Customize ordering, filtering, annotations, and heatmap colors.
- Calculate, inspect pairs, then export the required results.
Example data
| Study Hours | Attendance | Sleep Hours | Exam Score |
|---|---|---|---|
| 2.5 | 70 | 6.0 | 62 |
| 4.0 | 82 | 7.0 | 74 |
| 5.5 | 91 | 7.5 | 86 |
| 6.0 | 95 | 8.0 | 91 |
Machine learning applications
Covariance matrices reveal how features vary together across observations. They support PCA, Gaussian models, anomaly detection, and multicollinearity reviews. Unit scaling must be considered before comparing magnitudes.
Find variables that move together and inspect redundant information.
Use covariance eigenvectors to identify dominant directions of variation.
Describe multivariate spread and dependence through covariance structures.
Measure unusual observations while accounting for related features.
Frequently asked questions
What does positive covariance mean?
Positive covariance means two variables usually move in the same direction. Higher values of one often accompany higher values of another.
What does negative covariance mean?
Negative covariance means variables often move in opposite directions. As one increases, the other commonly decreases.
Does covariance measure relationship strength?
Its magnitude depends on variable units and scale. Correlation is usually easier for standardized strength comparisons.
What appears on the diagonal?
Each diagonal cell contains the variance of its variable. Variance measures spread around that variable's mean.
Should I use sample or population covariance?
Use sample covariance when data represents a sample. Use population covariance when every population observation is included.
What is pairwise missing-value handling?
Each covariance pair uses rows where both variables are valid. Different matrix cells may therefore use different observation counts.
Why can standardization change covariance?
Standardization rescales every variable to unit variance. The resulting covariance matrix becomes equivalent to a correlation matrix.
Does covariance prove causation?
No. Covariance indicates joint movement but cannot establish a causal relationship between variables.
Why must a covariance matrix be symmetric?
Covariance of X with Y equals covariance of Y with X. Corresponding cells should therefore match.
What is a positive-semidefinite covariance matrix?
Its eigenvalues are nonnegative within numerical tolerance. Valid complete-data covariance matrices normally satisfy this property.
When should I use correlation instead?
Use correlation when variables use different units or scales. It expresses linear association between negative one and positive one.