Joint Distribution

Parameters

Covariance

Measure of the direction of linear relationship between 2 variables. Depends on the scale and unit of the variables.

Discrete version:

Cov(X,Y)=∑x∑y(x−μX)(y−μY)⋅P(X=x,Y=y)\mathrm{Cov}(X, Y) = \sum_{x} \sum_{y} (x - \mu_X)(y - \mu_Y) \cdot P(X = x, Y = y)

Continuous version:

Cov(X,Y)=∫−∞∞∫−∞∞(x−μX)(y−μY)f(x,y) dx dy\mathrm{Cov}(X, Y) = \int_{-\infty}^\infty \int_{-\infty}^\infty (x - \mu_X)(y - \mu_Y) f(x, y) \, dx \, dy
Sign of covarianceDescription
PositiveVariables increase together
NegativeOne increases as other decreases
ZeroNo linear relationship

Correlation

Measure of strength and direction of linear relationship between 2 variables. Always in the range [−1,1][-1,1].

ρ=Cov(X,Y)σXσY\rho = \frac{\mathrm{Cov}(X, Y)}{\sigma_X \sigma_Y}

Sample Parameters

Sample Covariance

cov(X,Y)=1n−1∑i=1n(xi−xˉ)(yi−yˉ)\mathrm{cov}(X, Y) = \frac{1}{n - 1} \sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y})

Sample Correlation

r=cov(X,Y)sXsY=∑i=1n(xi−xˉ)(yi−yˉ)∑i=1n(xi−xˉ)2⋅∑i=1n(yi−yˉ)2r = \frac{\mathrm{cov}(X, Y)}{s_X s_Y} = \frac{\sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum_{i=1}^n (x_i - \bar{x})^2} \cdot \sqrt{\sum_{i=1}^n (y_i - \bar{y})^2}}
Written by September 29, 2026 1 min read
Was this helpful?