Let our data be:
X=โx1,1โโฆxn,1โโx1,2โxn,2โโx1,3โxn,3โโโฆโฆโx1,pโxn,pโโโ
Sample mean
Xห=โx1โหโx2โหโโฎxpโหโโโpร1โ
where each xiโ is another random variable. Expected Value.
xiโหโ=n1โj=1โnโxjiโย forย i=1,2,โฆ,p
Variance-Covariance Matrix
We denote sample Variance & Covariance in a matrix of size pรp.
Snโ=โs11โโฎsp1โโs12โโฑsp2โโโฆโฆโs1pโsppโโโ
Here any siiโ denote the variance of variable i and any sijโ denote the covariance between variable i and j.
sijโ=n1โk=1โnโ[(skiโโxkโหโ)(skjโโxjโหโ)]ย forย i,jโ1,2,โฆ,p
Sample Correlation
R=โ1r21โโฎrp1โโr12โ1โฎโฆโโฆโฆโฑโฆโr1pโr2pโr3pโ1โโpรpโ
where,
rijโ=V(xiโ)โV(xjโ)โCov(xiโ,xjโ)โ=siiโโsjjโโsijโโ
See Pearson correlation coefficient.