% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/2ld.R
\name{klem}
\alias{klem}
\title{Haplotype frequency estimation based on a genotype table of two multiallelic markers}
\usage{
klem(obs, k = 2, l = 2)
}
\arguments{
\item{obs}{a table of genotype counts.}

\item{k}{number of alleles at marker 1.}

\item{l}{number of alleles at marker 2.

The dimension of the genotype table should be k*(k+1)/2 x l*(l+1)/2.

Modified from 2ld.c.}
}
\value{
The returned value is a list containing:
\itemize{
\item h haplotype Frequencies.
\item l0 log-likelihood under linkage equilibrium.
\item l1 log-likelihood under linkage disequilibrium.
}
}
\description{
Haplotype frequency estimation using expectation-maximization algorithm based on a table of genotypes of two multiallelic markers.
}
\examples{
\dontrun{
# an example with known genotype counts 
z <- klem(obs=1:9)
# an example with imputed genotypes at SH2B1
source(file.path(find.package("gap"),"scripts","SH2B1.R"),echo=TRUE)
}

}
\seealso{
\code{\link{genecounting}}
}
\author{
Jing Hua Zhao
}
\keyword{htest}
