% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_quantgen.R
\name{estimGRM}
\alias{estimGRM}
\title{Estimate a GRM}
\usage{
estimGRM(M, AFs = NULL)
}
\arguments{
\item{M}{matrix of SNP genotypes, with individuals in rows and SNPs in columns, encoded in allele dose in \[0,2\]}

\item{AFs}{vector of allele frequencies; if NULL, will be estimated from \code{M}}
}
\value{
matrix
}
\description{
Estimates a genomic relationship matrix with the first estimator from VanRaden (2008).
}
\examples{
strong_div_pops <- diag(3)
strong_div_pops[upper.tri(strong_div_pops)] <- 0.5
strong_div_pops[lower.tri(strong_div_pops)] <- strong_div_pops[upper.tri(strong_div_pops)]
strong_div_pops
M <- simulGenosDoseStruct(div_pops=strong_div_pops)
A <- estimGRM(M)
imageMat(A, "Strong divergence")
}
\seealso{
\code{\link{simulGenosDoseStruct}}
}
\author{
Timothee Flutre
}
