exactLRR: Ratio of LRs and likelihoods calculated exactly for one...

View source: R/exactLRR.R

exactLRRR Documentation

Ratio of LRs and likelihoods calculated exactly for one marker

Description

The ratio Z = LR(M,p)/LR(R,p) is calculated exactly.

Usage

exactLRR(
  M,
  R = NULL,
  afreq = NULL,
  ped = nuclearPed(1),
  ids = c(1, 3),
  method = "PM",
  adjust = FALSE,
  ln = FALSE
)

Arguments

M

Mutation matrix

R

Mutation matrix with same dimension as M or NULL

afreq

A vector with allele frequencies, of the same length as the size of mutmat

ped

A ped object

ids

A numeric with ID labels of one or more pedigree members.

method

Character specifying reversing method.

adjust

Logical.

ln

Logical.

Details

If R == NULL, R is first made reversible with PM option, preserving the expected mutation rate.

Value

Expected ratio and likelihoods

Author(s)

Thore Egeland.

See Also

[makeReversible()].

Examples

ped = nuclearPed(1)
p = c("1" = 0.2, "2" = 0.8)
M = mutationMatrix("equal", afreq = p, alleles = 1:length(p), rate = 0.01)
R = makeReversible(M, method = "PM", afreq = p)
exactLRR(M, R, ln = FALSE)

## Not run: 
p = NorwegianFrequencies[[1]]
M = mutationMatrix("onestep",
    alleles = names(p),
    rate = 0.001,
    afreq = p)
attr(M, "rate") = expectedMutationRate(M, p)
res = exactLRR(M, R = NULL, ln = T)
R = makeReversible(M, afreq = p, method = "MH")
R2 = adjustReversible(M, R, afreq = p)
res2 = exactLRR(M, R = R, p)

## End(Not run)

thoree/mut2 documentation built on May 16, 2023, 7:56 p.m.