R/loglik.4.R

Defines functions loglik.4

loglik.4 <- function(pa,x,y,pam,paf) {
  nam <- 2*x[1]+x[2]
  naf <- 2*y[1]+y[2]
  nbm <- 2*x[3]+x[2]
  nbf <- 2*y[3]+y[2]
  logm <- sum(log(c(pam,1-pam,2))*c(nam,nbm,x[2])) 
  logf <- sum(log(c(paf,1-paf,2))*c(naf,nbf,y[2])) 
  loglik0 <- logm+logf
  nparam0 <- 2
  res <- c(loglik0,nparam0)
  return(res)
}

Try the HardyWeinberg package in your browser

Any scripts or data that you put into this service are public.

HardyWeinberg documentation built on May 7, 2022, 5:05 p.m.