# Math behind the Genetic Relationship Matrix

The genetic relationship matrix (GRM) can estimate the genetic relationship between two individuals ($j$ and $k$) over $m$ SNPs and $i$ representing a specific SNP. What I don't understand from their equation is why we divide our summation by $m$ (the number of SNPs). $x_{ij}$ is the number of copies of the minor allele for the $j$-th individual in SNP $i$. $p_i$ is the frequency of the minor allele for SNP $i$.

• I do not know anything about this GRM but it seems to me it is divided by m to represent the average relationship over all (m) SNPs. – ddiez Jun 18 '15 at 14:26
• I am not familiar with it either, sources would be very useful. But, this may answer your question, if it does let me know and I will post it as an answer... Summing over $m$ SNPs would give a result for a pair of individuals. But if you want a result which is comparable to other GRM's then you need an average which accounts for the number of SNPs measured, hence $1/m$ times the summation. Otherwise you two GRMs could have different scores purely because of the number of SNPs included. – rg255 Jun 18 '15 at 14:37
• ncbi.nlm.nih.gov/pmc/articles/PMC3014363 This is a link to the paper I am studying hope it helps fill in any missing information you need. – DaveRowan Jun 18 '15 at 14:42
• 1) did my comment answer your question (does it make sense?) 2) could you also edit the question to include the article link and explain what each term is e.g. $m$ denotes the number of loci, $i$ is ... $j$ is ... $k$ is.. $x$ is... and $p$ is... The question would be most valuable if it is able to stand alone (not require going to external sites/papers for definitions) – rg255 Jun 18 '15 at 14:54

This expression is a mean

$$\frac{1}{m}\sum_{i=1}^m ...$$

($m$ is the number of SNPs) of the ratio

$$\frac{numerator}{denominator}$$

where the numerator is a covariance

$$(a_i-C)(b_i-C)$$

and the denominator is the expected heterozygosity

$$2p_i(1-p_i)$$

Therefore, it represents how much do two individuals covary $(x_{ij})(x_{ik}-p_i)$ respectively to what is expected on average $2p_i(1-p_i)$ averaged over all SNPs $\frac{1}{m}\sum_{i=1}^m...$, where $m$ is the number of SNPs.

It is a relative measure (relative to the expected heterozygosity) of covariance between each individual (averaged over all SNPs).

Does it help?

• Evaluating it this way gives us the average correlation per SNP between two individuals which considering the amount of SNPs it will be a very small value and considering the the correlation will be between -1 and 1 i dont see the intuition behind dividing by the number of SNPs (m). Also does anyone know other methods of estimating the genetic relationship between two individuals? – DaveRowan Jun 18 '15 at 15:32
• I am not sure what confuses you with this division by $m$. When you calculated your average grade at school, you added all the grades and divide the whole think by the number of grades. This is what this division is. You add all the relative covariances for each SNPs (relative the expected heterozygosity) and you divide the whole thing by the number of SNPs. – Remi.b Jun 18 '15 at 15:42
• Does it make sense? You might just want to read about the arithmetic mean. – Remi.b Jun 19 '15 at 12:30
• A little complex but I will try to get it. Thanks for sharing a detailed analysis. – user17381 Aug 19 '15 at 9:35

$2p_i$ is the expectation of $SNP_i$:

$$E(SNP_i) = 0 \times (1-p_i)^2 + 1 \times 2p_i(1 - p_i) + 2 \times p_i^2 = 2 p_i$$

$(x_{ij} - 2p_i)(x_{ik} - 2p_i)$ measures how the two SNPs covary. I have no idea why they divide it by $2p_i(1 - p_i)$, but if you leave that one out, you have the plain definition of covariance.