Sample covariance calculator
Estimate sample covariance from paired X and Y observations using the n−1 denominator.
Calculator
How to use this calculator
Estimate sample covariance from paired X and Y observations using the n−1 denominator.
- Enter X values, comma-separated, Y values, comma-separated. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Sample covariance calculator
Estimate sample covariance from paired X and Y observations using the n−1 denominator.
What it measures
Covariance averages the products of paired deviations from each sample mean. Positive values indicate same-direction deviations; negative values indicate opposite-direction deviations.
Inputs and units
- X values, comma-separated: X values in the order they were paired.
- Y values, comma-separated: Y values in matching order; same list length as X.
Formula and method
sₓᵧ=Σ(xᵢ−x̄)(yᵢ−ȳ)/(n−1).
Worked example
For X=[1,2,3,4], Y=[2,1,4,3], the cross-deviation sum is 3 and sample covariance is 3/(4−1)=1.
Interpreting the result
Covariance retains product units and scale, so its magnitude is hard to compare across differently scaled variables; correlation standardizes it.
Assumptions and limits
Lists must have equal length with at least two finite pairs. Covariance is association, not evidence that one variable causes the other.
Sources and method
- Defines sample covariance using centered paired observations divided by n−1. NIST: Mean vector and covariance matrix
Frequently asked questions
Why divide by n−1?
That is the conventional unbiased sample-covariance estimator.
How does covariance differ from correlation?
Correlation divides by both standard deviations and is scale-free between −1 and 1.
How do I use the Sample covariance calculator?
Enter X values, comma-separated, Y values, comma-separated. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Sample covariance?
For X=[1,2,3,4], Y=[2,1,4,3], the cross-deviation sum is 3 and sample covariance is 3/(4−1)=1.
What does the Sample covariance calculator calculate?
Estimate sample covariance from paired X and Y observations using the n−1 denominator.
See the calculation methodology.
Good calculators show their work.
CalcWorldHub is built around clear inputs and visible assumptions. Results are estimates for planning; check official sources or your provider’s terms when exact figures matter.