R/likelihood.R

Defines functions loglikWrapper loglikTotal

#' @importFrom pedprobr likelihood
loglikTotal = function(x) {
  sum(likelihood(x, logbase = exp(1)))
}


# Main wrapper used in reconstruct()
loglikWrapper = function(ped, amatList, loci, founderInb = 0) {
  # Attach marker data
  x = setMarkersFAST(ped, amatList, loci)

  # Set founder inbreeding
  if(founderInb > 0)
    x = setFounderInbreeding(x, value = founderInb)

  # Return total loglik
  tryCatch(loglikTotal(x), error = function(e) NA_real_)
}

Try the pedbuildr package in your browser

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

pedbuildr documentation built on June 25, 2026, 9:06 a.m.